jed-users mailing list

[2009 Date Index] [2009 Thread Index] [Other years]
[Thread Prev] [Thread Next]      [Date Prev] [Date Next]

Re: integer to string


Hi Mark,

"Olesen, Mark" <Mark.Olesen@xxxxxxxxxxxxxxxxxxxxx> wrote:
>> May I suggest that you make only one change (= one changelog entry) per
>> commit. Sometimes you have more than one modification in one commit. But
>> as git is distributed, you can make small commits they are much more
>> readable.
>
> I'd guess it's a matter of taste.

Yes everybody can do it as he likes ;-), but the question is how good his
doing fits in the work flow of the tools he uses. For me, git has
revolutionised how I think about commits. I've used SVN before and a
commit was collection of modifications, nothing else than a BLOB.

But in git I've learned to make small commits they are closed, i.e. they
transform the repository from one sane [1] state to another sane state
(like a database transaction). These small commits tend to be more
readable than big commits, because they are redused to one thing. You
don't have to dig through other modifications, try to understand what
they do and realise they have nothing to do with the modification you're
interested in.

[1] What “sane” is is sometimes difficult to define, but for code
  repositories I use to say the code must compile and it a test suite
  exists this must be passed. For repositories with LaTeX documents it's
  much more difficult to say, also what a “small change” is.

When you have many branches and reuse commits (a git man would say cherry
pick them), it's much easier with small commits they make only one
modification than commits they make other unrelated modifications you
don't want to reuse.

The same holds for undoing commits (in git's language a revert). If you
want to undo a commit that introduces more than one feature or fixes more
than one bug at a time, you have to split this commit and do the revert
manually, i.e. you can't use a tool like git revert.

The closed nature of commits let tools like git bisect become a valuable
component of your toolbox. John's test suite (make -C src runtests) is
usable with git bisect run and this is very wonderful. In commit
“pre0.99.19 changes 205-207” a new test slipped in that make the test
suite break. It was very easy to find this commit with git bisect.

So, it's not completely a matter of taste, if you want to get the comfort
of the tools provided by your VCS.

Regards, Jörg.
-- 
Gienger's Law (http://www.bruhaha.de/laws.html):
Die Wichtigkeit eines Newspostings im Usenet ist reziprok zur Anzahl der
enthaltenenen, kumulierten Ausrufungszeichen.

--------------------------
To unsubscribe send email to <jed-users-request@xxxxxxxxxxx> with
the word "unsubscribe" in the message body.
Need help? Email <jed-users-owner@xxxxxxxxxxx>.


[2009 date index] [2009 thread index]
[Thread Prev] [Thread Next]      [Date Prev] [Date Next]