emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: About commit style


From: Eli Zaretskii
Subject: Re: About commit style
Date: Sat, 06 Apr 2013 11:52:44 +0300

> Date: Sat, 6 Apr 2013 16:13:08 +0800
> From: Xue Fuqiao <address@hidden>
> 
> In admin/notes/commits:
> 
>    Each commit should correspond to a single change (whether spread over
>    multiple files or not).  Do not mix different changes in the same
>    commit (eg adding a feature in one file, fixing a bug in another
>    should be two commits, not one).
> 
> Can I mix changes in _one_ file?  (E.g., adding a feature in one file,
> fixing a bug in the same file)

No, you cannot.

> When I want to add a feature in a file, I often find bugs in the
> same file.

Then fix the bugs (one by one, if they are different) in separate
commits, and then finally add the feature in one more commit.  You can
use separate branches for that, to reduce inconvenience if you find
the bugs when you are already half way into adding the feature.

The only fixes that can be mixed with other changes are whitespace
changes, incorrect formatting, etc.

The point to take here is that reverting a single revision does not
inadvertently introduces changes unrelated to the issue that is the
subject of that revision.  E.g., suppose your feature changes were
found to be incorrect or undesirable, and are reverted -- you don't
want that to re-introduce the unrelated bugs you fixed while working
on the feature, do you?



reply via email to

[Prev in Thread] Current Thread [Next in Thread]