unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* About commit style
@ 2013-04-06  8:13 Xue Fuqiao
  2013-04-06  8:52 ` Eli Zaretskii
  0 siblings, 1 reply; 12+ messages in thread
From: Xue Fuqiao @ 2013-04-06  8:13 UTC (permalink / raw)
  To: emacs-devel

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)  When I want to add a feature in a file,
I often find bugs in the same file.  It is convenient and natural to fix
them without extra trouble, I think.

-- 
Xue Fuqiao
http://www.gnu.org/software/emacs/



^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: About commit style
  2013-04-06  8:13 About commit style Xue Fuqiao
@ 2013-04-06  8:52 ` Eli Zaretskii
  2013-04-06  9:08   ` Eli Zaretskii
                     ` (2 more replies)
  0 siblings, 3 replies; 12+ messages in thread
From: Eli Zaretskii @ 2013-04-06  8:52 UTC (permalink / raw)
  To: Xue Fuqiao; +Cc: emacs-devel

> Date: Sat, 6 Apr 2013 16:13:08 +0800
> From: Xue Fuqiao <xfq.free@gmail.com>
> 
> 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?



^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: About commit style
  2013-04-06  8:52 ` Eli Zaretskii
@ 2013-04-06  9:08   ` Eli Zaretskii
  2013-04-06 11:03     ` Xue Fuqiao
  2013-04-06 13:10   ` Stefan Monnier
  2013-04-07  6:17   ` Xue Fuqiao
  2 siblings, 1 reply; 12+ messages in thread
From: Eli Zaretskii @ 2013-04-06  9:08 UTC (permalink / raw)
  To: xfq.free; +Cc: emacs-devel

> Date: Sat, 06 Apr 2013 11:52:44 +0300
> From: Eli Zaretskii <eliz@gnu.org>
> Cc: emacs-devel@gnu.org
> 
> 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.

Or shelve your changes, fix the bug, commit it, then unshelve the
changes and continue.

Of (if you develop the feature on a separate branch), fix the bugs on
the trunk, in which case they don't affect your feature branch work.

Or cherry-pick versions from branch to trunk, when you commit.

I'm sure there are more ways of doing this, so that (a) bugfixes are
separate from unrelated features, and (b) your development workflow is
not disrupted or inconvenienced in any way.



^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: About commit style
  2013-04-06  9:08   ` Eli Zaretskii
@ 2013-04-06 11:03     ` Xue Fuqiao
  0 siblings, 0 replies; 12+ messages in thread
From: Xue Fuqiao @ 2013-04-06 11:03 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: emacs-devel

On Sat, 06 Apr 2013 12:08:15 +0300
Eli Zaretskii <eliz@gnu.org> wrote:

> > Date: Sat, 06 Apr 2013 11:52:44 +0300
> > From: Eli Zaretskii <eliz@gnu.org>
> > Cc: emacs-devel@gnu.org
> > 
> > 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.
> 
> Or shelve your changes, fix the bug, commit it, then unshelve the
> changes and continue.
> 
> Of (if you develop the feature on a separate branch), fix the bugs on
> the trunk, in which case they don't affect your feature branch work.
> 
> Or cherry-pick versions from branch to trunk, when you commit.
> 
> I'm sure there are more ways of doing this, so that (a) bugfixes are
> separate from unrelated features, and (b) your development workflow is
> not disrupted or inconvenienced in any way.

I see, thank you.  I'll capture (using `org-capture') the bug if it
doesn't affect my feature branch work.  If not, I'll fix it first.

-- 
Xue Fuqiao
http://www.gnu.org/software/emacs/



^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: About commit style
  2013-04-06  8:52 ` Eli Zaretskii
  2013-04-06  9:08   ` Eli Zaretskii
@ 2013-04-06 13:10   ` Stefan Monnier
  2013-04-06 15:02     ` Eli Zaretskii
  2013-04-07  6:17   ` Xue Fuqiao
  2 siblings, 1 reply; 12+ messages in thread
From: Stefan Monnier @ 2013-04-06 13:10 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: Xue Fuqiao, emacs-devel

> Then fix the bugs (one by one, if they are different)

If they're trivial enough, it's perfectly OK to lump them together.


        Stefan



^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: About commit style
  2013-04-06 13:10   ` Stefan Monnier
@ 2013-04-06 15:02     ` Eli Zaretskii
  2013-04-06 15:32       ` Stefan Monnier
  0 siblings, 1 reply; 12+ messages in thread
From: Eli Zaretskii @ 2013-04-06 15:02 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: xfq.free, emacs-devel

> From: Stefan Monnier <monnier@iro.umontreal.ca>
> Date: Sat, 06 Apr 2013 09:10:43 -0400
> Cc: Xue Fuqiao <xfq.free@gmail.com>, emacs-devel@gnu.org
> 
> > Then fix the bugs (one by one, if they are different)
> 
> If they're trivial enough, it's perfectly OK to lump them together.

What are "trivial bugs" in this context?  Something beyond typos and
whitespace changes?



^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: About commit style
  2013-04-06 15:02     ` Eli Zaretskii
@ 2013-04-06 15:32       ` Stefan Monnier
  2013-04-06 15:46         ` Andreas Röhler
  0 siblings, 1 reply; 12+ messages in thread
From: Stefan Monnier @ 2013-04-06 15:32 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: xfq.free, emacs-devel

>> > Then fix the bugs (one by one, if they are different)
>> If they're trivial enough, it's perfectly OK to lump them together.
> What are "trivial bugs" in this context?  Something beyond typos and
> whitespace changes?

Bugs which are due to using "just not quite the right code".
E.g. renaming a function/variable to use a proper prefix.


        Stefan



^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: About commit style
  2013-04-06 15:32       ` Stefan Monnier
@ 2013-04-06 15:46         ` Andreas Röhler
  0 siblings, 0 replies; 12+ messages in thread
From: Andreas Röhler @ 2013-04-06 15:46 UTC (permalink / raw)
  To: emacs-devel

Am 06.04.2013 17:32, schrieb Stefan Monnier:
>>>> Then fix the bugs (one by one, if they are different)
>>> If they're trivial enough, it's perfectly OK to lump them together.
>> What are "trivial bugs" in this context?  Something beyond typos and
>> whitespace changes?
>
> Bugs which are due to using "just not quite the right code".
> E.g. renaming a function/variable to use a proper prefix.
>
>
>          Stefan
>
>

Just for completeness it might pay to consider the case of a re-write too.
It must neither fix a bug nor introduce new features but might affect a bunch of lines.

During such a re-write a couple of steps deserve notice, while some of them will turn
out not so useful, being revoked before final commit.

Andreas



^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: About commit style
  2013-04-06  8:52 ` Eli Zaretskii
  2013-04-06  9:08   ` Eli Zaretskii
  2013-04-06 13:10   ` Stefan Monnier
@ 2013-04-07  6:17   ` Xue Fuqiao
  2013-04-07 15:41     ` Eli Zaretskii
  2013-04-07 15:48     ` Stefan Monnier
  2 siblings, 2 replies; 12+ messages in thread
From: Xue Fuqiao @ 2013-04-07  6:17 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: emacs-devel

On Sat, 06 Apr 2013 11:52:44 +0300
Eli Zaretskii <eliz@gnu.org> wrote:

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

In etc/CONTRIBUTE:
---------------------------------------------------------------------
|** Do not make formatting changes.
|
|Making cosmetic formatting changes (indentation, etc) makes it harder
|to see what you have really changed.
---------------------------------------------------------------------

Can I make changes like this:

* Reindent the file using the default indentation parameters.

* Change some code from putting close-parentheses on lines by themselves
  to Lisp style.  (Although this almost never happened.)

* Change the comments to satisfy (info "(elisp) Comment Tips").

-- 
Xue Fuqiao
http://www.gnu.org/software/emacs/



^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: About commit style
  2013-04-07  6:17   ` Xue Fuqiao
@ 2013-04-07 15:41     ` Eli Zaretskii
  2013-04-07 15:48     ` Stefan Monnier
  1 sibling, 0 replies; 12+ messages in thread
From: Eli Zaretskii @ 2013-04-07 15:41 UTC (permalink / raw)
  To: Xue Fuqiao; +Cc: emacs-devel

> Date: Sun, 7 Apr 2013 14:17:06 +0800
> From: Xue Fuqiao <xfq.free@gmail.com>
> Cc: emacs-devel@gnu.org
> 
> On Sat, 06 Apr 2013 11:52:44 +0300
> Eli Zaretskii <eliz@gnu.org> wrote:
> 
> > The only fixes that can be mixed with other changes are whitespace
> > changes, incorrect formatting, etc.
> 
> In etc/CONTRIBUTE:
> ---------------------------------------------------------------------
> |** Do not make formatting changes.

It means "do not make formatting changes ALONE".  They are OK as part
of another, non-trivial change.



^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: About commit style
  2013-04-07  6:17   ` Xue Fuqiao
  2013-04-07 15:41     ` Eli Zaretskii
@ 2013-04-07 15:48     ` Stefan Monnier
  2013-04-07 22:22       ` Xue Fuqiao
  1 sibling, 1 reply; 12+ messages in thread
From: Stefan Monnier @ 2013-04-07 15:48 UTC (permalink / raw)
  To: Xue Fuqiao; +Cc: Eli Zaretskii, emacs-devel

> * Reindent the file using the default indentation parameters.

No.  You can only fix local misindentation.

Any "bulk" cosmetic changes are annoying because they are sure to bump into
someone's local changes, creating spurious conflicts.

> * Change some code from putting close-parentheses on lines by themselves
>   to Lisp style.  (Although this almost never happened.)

Same here: doing it somewhere where you're already making other changes
is fine, but doing it systematically is not.

> * Change the comments to satisfy (info "(elisp) Comment Tips").

Idem.


        Stefan



^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: About commit style
  2013-04-07 15:48     ` Stefan Monnier
@ 2013-04-07 22:22       ` Xue Fuqiao
  0 siblings, 0 replies; 12+ messages in thread
From: Xue Fuqiao @ 2013-04-07 22:22 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: Eli Zaretskii, emacs-devel

On Sun, 07 Apr 2013 11:48:47 -0400
Stefan Monnier <monnier@iro.umontreal.ca> wrote:

> > * Reindent the file using the default indentation parameters.
> 
> No.  You can only fix local misindentation.
> 
> Any "bulk" cosmetic changes are annoying because they are sure to bump into
> someone's local changes, creating spurious conflicts.
> 
> > * Change some code from putting close-parentheses on lines by themselves
> >   to Lisp style.  (Although this almost never happened.)
> 
> Same here: doing it somewhere where you're already making other changes
> is fine, but doing it systematically is not.
> 
> > * Change the comments to satisfy (info "(elisp) Comment Tips").
> 
> Idem.

I see, thanks.

-- 
Xue Fuqiao
http://www.gnu.org/software/emacs/



^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2013-04-07 22:22 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-04-06  8:13 About commit style Xue Fuqiao
2013-04-06  8:52 ` Eli Zaretskii
2013-04-06  9:08   ` Eli Zaretskii
2013-04-06 11:03     ` Xue Fuqiao
2013-04-06 13:10   ` Stefan Monnier
2013-04-06 15:02     ` Eli Zaretskii
2013-04-06 15:32       ` Stefan Monnier
2013-04-06 15:46         ` Andreas Röhler
2013-04-07  6:17   ` Xue Fuqiao
2013-04-07 15:41     ` Eli Zaretskii
2013-04-07 15:48     ` Stefan Monnier
2013-04-07 22:22       ` Xue Fuqiao

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).