News for hackers. Stuff that matters.
Re:Four rules for effective collaboration – Guidelines for b... by C4stor on Wednesday March 07, 2018 @08:16AM (#16536117)
So you say to me rule 2 for effective collaboration is answering those 5 questions :

Why is this change necessary? What assumptions is it based on? Were any alternative solutions considered? Why was this solution chosen from among the alternatives? Are there any non-obvious implications that this change has?

But none of the proposed rules actually answer those 5 questions in their explanation.

Re:Four rules for effective collaboration – Guidelines for b... by hinkley on Wednesday March 07, 2018 @11:11AM (#16537318)
Three to four of these should be captured in your ticketing system. Only why should go in the commit, along with the story number.

If you have never used tools that can automatically link commit messages to stories you are truly missing out.

Re:Four rules for effective collaboration – Guidelines for b... by ozim on Wednesday March 07, 2018 @10:08AM (#16536859)
Also then you get people writing their life time stories in commit messages instead of writing code, good luck with velocity.
Re:Four rules for effective collaboration – Guidelines for b... by deiwin on Wednesday March 07, 2018 @10:19AM (#16536926)
Thinking that providing additional context for commits is a waste of time is short-sighted. Yes, it requires more time and effort in the short-term (i.e. for creating the commit), but if it's a complex, long-lived project, then that extra effort will save a lot of time in the long run.

Sometimes the extra time and effort is already made up for in the review process, which without proper context could drag out and cause a lot of back and forth. Sometimes it might save somebody hours and days of investigation time. This is not to mention the benefits that both the author and the readers of the commit get by better understanding both the problem and the solution.

Re:Four rules for effective collaboration – Guidelines for b... by ozim on Wednesday March 07, 2018 @10:28AM (#16536996)
People are bad at finding out what is important and what is not. Most of the time I have to cut through not relevant stuff that others thought would be important for fixing some issue. Lot more than some insightful commit saved my day, but maybe that is just my environment.

Anyway good luck fixing anything trusting commit messages from long time ago. Code is truth and if you won't investigate you still don't know how it works.

Re:Four rules for effective collaboration – Guidelines for b... by mabbo on Wednesday March 07, 2018 @10:26AM (#16536980)
Writing more code that no one understands the reason for is not better than writing explanations of why you wrote some code.
Re:Four rules for effective collaboration – Guidelines for b... by programmarchy on Wednesday March 07, 2018 @12:13PM (#16537848)
Then why not focus on writing readable code? And when you do need to write a workaround or something hard to understand, then document it in the code itself with a comment. It'll be recorded in the diff of the commit, plus it'll be more accessible when reading the codebase as a whole.
Re:Four rules for effective collaboration – Guidelines for b... by mabbo on Wednesday March 07, 2018 @12:49PM (#16538195)
These aren't mutually exclusive things. Write readable code so people can see how you did it. Write complete commit messages so that people understand why you did it. Especially with older codebase, hairier things you inherit that are full of monsters and WTFs, you need both.

It's more work for you, but it saves the rest of the team even more time. It helps the dev reading it in three years understand, when he git blames to figure out why you did this strange thing.

Re:Four rules for effective collaboration – Guidelines for b... by purple-again on Wednesday March 07, 2018 @07:18AM (#16535881)
Four rules for how to effectively collaborate with me and people that agree with me.

One rule for how to effectively collaborate - talk to the people you are trying to collaborate with about expectations and then follow them. Try to remember along the way that you are all human.

Re:Four rules for effective collaboration – Guidelines for b... by Cthulhu_ on Wednesday March 07, 2018 @09:39AM (#16536636)
On the other hand, using this as a baseline and evolve from there will save a lot of time. I mean git conventions are starting to sound a bit like tabs vs spaces, just with a lot more options.

Pick a standard example, go with that, evolve. Same with e.g. processes, pick e.g. scrum, do it by the book at first, evolve.

I've started at half a dozen projects and every time a huge amount of time is being spent (wasted) on reinventing the wheel, be it processes, version control, code style, etc.

Re:Four rules for effective collaboration – Guidelines for b... by deiwin on Wednesday March 07, 2018 @07:36AM (#16535936)
You're correct. There are more fundamental conditions that have to be met for effective collaboration.
Re:Four rules for effective collaboration – Guidelines for b... by ozim on Wednesday March 07, 2018 @10:06AM (#16536849)
Maybe get your ticketing system tied to repo and add reference ticket number form a system where whole context can be provided in a proper way.

"Every commit should be complete." and "Every commit should only do a single thing." and then make it in a way that someone could actually review changes. In most cases it is not possible, more often it is complete or does single thing.

Re:Four rules for effective collaboration – Guidelines for b... by sirsuki on Wednesday March 07, 2018 @10:34AM (#16537050)
In my experience these assertions are untrue. Also the tickets are often the over arching context and will have nothing to do with the code. My product owner doesn't care if I had to try three different algorithms till I got it right; but my colleagues and my future self sure would love to see that and all the stack overflow links during a git bisect!

Not only that but the ticket is a full feature. Maybe it took 5 commits to get there: "Fix bad indenting", "Extract base logic to command object", "Update I18N entries", "Add missing tests for current behavior", "Add the feature asked for".

Re:Four rules for effective collaboration – Guidelines for b... by ozim on Wednesday March 07, 2018 @04:28PM (#16540068)
From what I see you just agree with my comment. Those 5 commits you described as example are the way I would do it.

The way it is described in article would make you do it in one commit and add information that would be in the ticket.

Re:Four rules for effective collaboration – Guidelines for b... by deiwin on Thursday March 08, 2018 @12:26AM (#16542499)
Also, the ticket and the commits can provide answers to the same questions without being redundant. The answers are just at a different level of abstraction and for different readers. Tickets usually describe product-level decisions, while commits describe implementation-specific details. E.g. a ticket may discuss alternative user flows, while a related commit explains why a specific algorithm, module, or default configuration value was used.
Re:Four rules for effective collaboration – Guidelines for b... by deiwin on Wednesday March 07, 2018 @04:49PM (#16540244)
What makes you say that? The Focused rule from the article is also meant to persuade you to split the work into similarly concise and focused commits.
Re:Four rules for effective collaboration – Guidelines for b... by ozim on Thursday March 08, 2018 @02:34AM (#16542943)
Focused and complete are opposite. You can have focused commits or complete commits.
Re:Four rules for effective collaboration – Guidelines for b... by deiwin on Wednesday March 07, 2018 @10:23AM (#16536956)
Tying the ticketing system and the repository together is a good idea and definitely worth implementing, but there's a fine balance in deciding what context should be kept in the ticket and what in the code repository. If you put too much into to the ticket and too little into the commits, then git blame loses it's value, for example.
Re:Four rules for effective collaboration – Guidelines for b... by ozim on Wednesday March 07, 2018 @10:31AM (#16537024)
Yes just be reasonable, whatever it means in context of change/team/project.
Re:Four rules for effective collaboration – Guidelines for b... by hinkley on Wednesday March 07, 2018 @12:42PM (#16538132)
All of these are prescriptions for establishing a narrative for your commits.

First you must convince people that the obviousness of their commits decays rapidly. What was obvious ten commits ago will be completely opaque three hundred commits from now.

Then you must convince them that the descriptions of the commits are often instrumental in fixing bugs without introducing regressions.

And to do both of these you must convince them that this code will survive for a long time. Everyone behaves like they won’t be here for the consequences or like they can “fix it later”. One of those tomorrows never comes.

Re:Four rules for effective collaboration – Guidelines for b... by jwilk on Wednesday March 07, 2018 @08:22AM (#16536134)
It's a bit baffling that git.git suggests using 7-characters commit abbreviations, when they already have collisions for them:

  $ git log --oneline | cut -c 1-7 | sort | uniq -c | grep -v ' 1 '
        2 1536dd9
        2 191f241
        2 2e6e3e8
        2 3b130ad
        2 d53a350
Re:Four rules for effective collaboration – Guidelines for b... by deiwin on Wednesday March 07, 2018 @09:47AM (#16536697)
Where did you find the 7 character suggestion? 7 used to be the default suggestion, but the problem of collisions has been acknowledged and dealt with by the git project. Linus himself authored the change that made the abbreviated revision length vary based on the size of the repository: https://github.com/git/git/commit/e6c587c733b4634030b353f402.... Also, the command for creating references to other commits which comes from the git project and is linked to in the article also uses automatic abbreviation length.
Re:Four rules for effective collaboration – Guidelines for b... by Cthulhu_ on Wednesday March 07, 2018 @09:41AM (#16536647)
7 characters should be enough for most repos, and iirc git can deal with collisions already (so git co 1536dd9 in your example would bring a prompt).

How many commits is the repo you're running this on btw?

Re:Four rules for effective collaboration – Guidelines for b... by pleasecalllater on Wednesday March 07, 2018 @12:31PM (#16538017)
Sure. And randomly generated UUIDs should not conflict... unless they do, and blow up a huge app in production. Yes, I have experienced that once.
Re:Four rules for effective collaboration – Guidelines for b... by msingle on Thursday March 08, 2018 @12:19AM (#16542466)
the odds of truly randomly generated UUID's conflicting are .... really really low (see https://en.wikipedia.org/wiki/Universally_unique_identifier#...). If you had a collision, then the odds are truly opposed to anyone else ever having that problem in the foreseeable future, so thanks for taking the hit for the rest of us!
Re:Four rules for effective collaboration – Guidelines for b... by chiefalchemist on Wednesday March 07, 2018 @07:35AM (#16535933)
This should be retitled: Reasons Why The CL is Flawed.

Long to short, why can't this be a form of some sort? Engineers / developers have enough to worry about, why add more minutia to the pile?

The CL is not an adequate OSFA solution. If quality and quantity is a concern, when is that going to be addressed?

Re:Four rules for effective collaboration – Guidelines for b... by noxToken on Wednesday March 07, 2018 @09:11AM (#16536412)
I don't understand what a form has to do with CL tools and their weaknesses. If you think that a form would help create better commits and commit messages, you can set one up in the CL. You can think of all of Git's interactive options as forms or wizards.

There is also pulling commit messages from a file. The commit -F /path/to/file switch allows you to specify a file that Git will pull text from. I try to write my commit messages before I make a change, because it helps me ensure that everything I'm working on satisfies the single-thing-per-commit rule. I always update the same file, so I made it an alias:

    git config --global alias.commit-txt 'commit -F ~/commit.txt'
Edit: If you're unfamiliar with how aliases work, you create one with the above invocation. The portion after alias. is the command you define and want to type. The portion in single-quotes is the actual git command. Thus, you'd type

    $ git commit-txt
to use the above command. What the command line sees is

    $ git commit -F ~/commit.txt
Re:Four rules for effective collaboration – Guidelines for b... by chiefalchemist on Saturday March 10, 2018 @11:14PM (#16561670)
A form would allow a team to define what gets entered, just like a checkout form defines a sellers needs. As it is, it's left up to human memory. That's flawed. I thought we knew and agreed on this.
Re:Four rules for effective collaboration – Guidelines for b... by Cthulhu_ on Wednesday March 07, 2018 @09:43AM (#16536670)
> Long to short, why can't this be a form of some sort? Engineers / developers have enough to worry about, why add more minutia to the pile?

It can! See Commitizen and its cli, used by e.g. the Angular project, which offers a cli wizard for filling in a commit message - type (fix, feature, chore, ci, doc, etc), scope (depends on project, one word category), short description, backwards-incompatble changes, etc; see http://commitizen.github.io/cz-cli/. This system can then be used to generate changelogs and do semantic versioning compatible version bumps - patch releases if the diff since the last tag only contains 'fix', minor if it contains 'feat', major if it contains backwards incompatible changes.

Re:Four rules for effective collaboration – Guidelines for b... by jwilk on Wednesday March 07, 2018 @08:08AM (#16536081)
What's CL?
Re:Four rules for effective collaboration – Guidelines for b... by jakobbuis on Wednesday March 07, 2018 @09:23AM (#16536502)
Commit log
Re:Four rules for effective collaboration – Guidelines for b... by whelchel on Wednesday March 07, 2018 @08:15AM (#16536112)
Command line it seems
Re:Four rules for effective collaboration – Guidelines for b... by neogodless on Wednesday March 07, 2018 @01:21PM (#16538497)
What's OSFA?
Re:Four rules for effective collaboration – Guidelines for b... by deiwin on Wednesday March 07, 2018 @02:07PM (#16538898)
One Size Fits All, probably.
Re:Four rules for effective collaboration – Guidelines for b... by galaxyLogic on Wednesday March 07, 2018 @10:50AM (#16537178)
I used to work with people who didn't comment their commits at all. The company went belly up