git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Chris Johnsen <chris_johnsen@pobox.com>
Cc: git@vger.kernel.org, Miklos Vajna <vmiklos@frugalware.org>
Subject: Re: [PATCH/RFD] builtin-revert.c: release index lock when cherry-picking an empty commit
Date: Sun, 08 Mar 2009 14:53:32 -0700	[thread overview]
Message-ID: <7v7i2zk7fn.fsf@gitster.siamese.dyndns.org> (raw)
In-Reply-To: <B0CBEE84-0F46-4AF2-86B1-C80BADAEF4E5@pobox.com> (Chris Johnsen's message of "Sun, 8 Mar 2009 16:09:50 -0500")

Chris Johnsen <chris_johnsen@pobox.com> writes:

> My confusion was that I took "usually a mistake" to refer to the case
> where the user meant to commit content changes but forgot to first
> stage any changed content. But your clarification shows that "usually
> a mistake" really means that making any empty commit, intentional or
> not, is (considered to be) a fundamental misuse of SCM machinery.

The empty commits in your example a few messages ago are used as "piss in
the snow" marking.  If you did not have tags (and commit notes), it may be
the only workaround to say "here is an interesting point", but even then
such a workaround can only be made while the commit is at the tip, and be
made useful only by forcing all the other commits on the branch be on top
of that "piss in the snow" commit, so it is a flawed workaround.

Suppose you have this history.

 ---A---B---C

You found that the point C is interesting in some way, so you mark it:

 ---A---B---C---P

But somebody else may have developed on top of C bypassing P

              D---E---F
             /
 ---A---B---C---P

What would you do in such a case?  You cannot leave P dangling, as that
would mean P will not participate in future rebases (and you do not want
to rebase P on top of F because C is the point that is interesting to you,
not F).  Do you merge F and P only to make P not dangling?  What does such
a merge mean?

Worse yet, if you stared from the original history with three commits, how
would you mark that B is interesting?

          P   D---E---F
         /   /
 ---A---B---C


The facility git and other SCM offer you to leave such mark (possibly
after the fact) is to use tags.

So in your particular "piss in the snow" usage, I would agree that such an
empty commit is a misuse.

I am not however claiming that all uses of an empty commit are fundamental
misuses here, though.  Somebody else may have other valid uses.

  reply	other threads:[~2009-03-08 21:55 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-07  9:30 [PATCH/RFD] builtin-revert.c: release index lock when cherry-picking an empty commit Chris Johnsen
2009-03-07 11:15 ` Johannes Schindelin
2009-03-07 22:57   ` Chris Johnsen
2009-03-08  1:19     ` Johannes Schindelin
2009-03-08  4:14 ` Junio C Hamano
2009-03-08 21:09   ` Chris Johnsen
2009-03-08 21:53     ` Junio C Hamano [this message]
2009-03-08 14:42 ` Jeff King
2009-03-08 15:09   ` Jeff King
2009-03-08 19:45   ` Junio C Hamano
2009-03-10 18:17     ` Jeff King
2009-03-10 18:25       ` Tomas Carnecky
2009-03-10 19:33       ` Tomas Carnecky
2009-03-10 23:57       ` Chris Johnsen
2009-03-11  0:30         ` Jeff King
2009-03-11 11:08           ` Mike Ralphson
2009-03-11 17:02             ` Mike Ralphson
2009-03-22  9:41             ` Jeff King
2009-03-22 21:58               ` Junio C Hamano
2009-03-22 22:38                 ` Jeff King
2009-03-09 17:36   ` Brandon Casey

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7v7i2zk7fn.fsf@gitster.siamese.dyndns.org \
    --to=gitster@pobox.com \
    --cc=chris_johnsen@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=vmiklos@frugalware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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 NNTP newsgroup(s).