GitHub - Shiny new commit styles
github.com
github.com
Here's an example changelog: http://github.com/akkartik/wart/commits/unstable. Criticisms?
Git provides a wealth of tools to craft perfect commits, and if you use them, it's not difficult to end up with a nice history of "add this, remove that, modify something else" changesets that (usually) would make sense even when separated from the surrounding history.
Pointers please?
In short, the index allows you to decide what goes in a single commit, regardless of the actual contents of a working directory. You can commit only a single line from a file if you want. If you learn how the index works and why it works like it does, understanding the rest becomes much easier.
You can also eg. resolve a conflict piece-by-piece by adding resolved parts to the index, diffing against the working directory, and then finally committing once the content of the index looks correct.
There are many tutorials and I'm not sure which one is the best but I think the book "Pro Git" does a good job at explaining the index among other things. It's freely available online at http://progit.org
I like to commit (quite) frequently when working on something, but later I feel that work-in-progress commits are just hindrance. When looking at project history after two year, I'll be glad if there is a single, larger commit "implemented feature x". Rebase is your friend.
I like to refer to 'commit 347' rather than 'commit a3bh'. There's an implicit sense of how old a commit is.
Also provide useful messages, if you want to look up changes to something you really want to be able to do a `git log | grep foo`.
(see also http://news.ycombinator.com/item?id=2967295)
Further more, having that kind of naming scheme might actually hold you back from doing parallel development - aka using git to its full potential. I regularly make use of branching even in my personal projects. For example starting the development of new experimental feature while still continuing fixing bugs in the master branch.
The larger the commit numbers grow the smaller will be difference between a number 1935 and git hash af23cc. Besides, git provides easy means for referring to the most recent commits using HEAD, HEAD^, HEAD^^ and so on. There's also --since option for going further back in time.
As a result your commits now have two revision numbers: the hash used and maintained by git and the number used and maintained by you. But there's no escaping from hashes. You're forced to use them anyway. So why supplement them with your own revision numbers? That's like having a digital library system and maintaining a perfo-cards archive at parallel.
I'm not talking about referring to commits on the commandline. You're right, I use hashes for that[1]. I'm talking about referring to commits in later commits: http://github.com/akkartik/wart/commit/0f087dbaee. It's immediately obvious that I'd broken the app for a dozen commits.
If the project were ever to get so popular that people started submitting bugs and it needed parallel development I'd.. stop using numbers. If I were to get to 293547, ditto. But I think 1935 will be perfectly useable.
[1] I like hashes. I also like separating concerns. My friends have seen me wearing a woolen cap, a raincoat hoodie and a baseball cap, all at once. What? It gets cold and rainy and sunny all at once in Texas, and hoodies suck at keeping the sun out. Every cap or number should do one thing well.
My convention is that commits without messages only reorganized or refactored code, without adding behavior or tests.
In my mind, it's on par with inconsistent whitespace in code indentation. Sometimes I notice these things more and find it hard to focus on other details, but most of the time I can glance over them.
whitelist of un-GC'd syms - Did you implement a whitelist feature, write whitelist data, update whitelist data, work on whitelisting in general?
oops, hadn't fully finished a!b ssyntax - Did you finish the syntax, or did you work around it for now?
failing test for apply - Did you add the test, make the test pass?
As a non-native speaker I have to wonder if this is really about past tense vs. present tense though. How should I grammatically interpret the suggested "Fix bug" as opposed to the alternative "Fixed bug"?
Past: [I] fixed bug. [This] fixed bug.
Present: [I] fix bug. [This] fix bug. Fix bug!
Infinitive: [To] fix bug. [I want to] fix bug. [This serves to] fix bug.
The suggestion may actually be towards the last option that doesn't have a tense. It's like an item in a todo list. That would make the most sense?