public inbox for git@vger.kernel.org 
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox•com>
To: martin f krafft <madduck@debian•org>
Cc: Jeff King <peff@peff•net>,
	"Aneesh Kumar K.V" <aneesh.kumar@linux•vnet.ibm.com>,
	Aneesh Kumar <aneesh.kumar@gmail•com>,
	git@vger•kernel.org, pasky@suse•cz
Subject: Re: [topgit] tg update error
Date: Fri, 13 Feb 2009 01:04:16 -0800	[thread overview]
Message-ID: <7v63jebtdb.fsf@gitster.siamese.dyndns.org> (raw)
In-Reply-To: <7vmycqeqqh.fsf@gitster.siamese.dyndns.org> (Junio C. Hamano's message of "Thu, 12 Feb 2009 23:32:54 -0800")

Junio C Hamano <gitster@pobox•com> writes:

> If you *are* setting HEAD to some ref that is outside refs/heads (or even
> inside refs/heads for that matter), at that point the HEAD is *not*
> detached, so no, it obviously is *not* what is happening.
>
> I am asking why you need to use a ref to do that, *if* it is a tentative
> state while the program is running.  You are probably calling a git
> plumbing or Porcelain command that updates HEAD, and the reason why you
> point HEAD outside refs/heads/ is beause you would want the command you
> call to update one of the refs/top-bases/ ref through HEAD.  I am asking
> why you are not running these commands on a normal detached HEAD, and then
> use update-ref (not symbolic-ref) plumbing to update the refs/top-bases/
> ref you would want to update when it is done.

Ok, I did read the script (yuck).  You do break out of TopGit process when
a merge conflict prevents the update operation to complete and do give
control back to the end user, so you can leave HEAD in a state that points
at a non-branch, and you do use the fact that the HEAD is pointing at
something funny as a sign that you are in the middle of conflicted merge
resolution.

It is just like how vanilla git uses MERGE_HEAD as the marker to signal
that it is in a funny state.

While I think it is a cute idea to use which funny hierarchy HEAD points
at to indicate what funny/intermediate state your interrupted operation is
in, and it may seem to be cleaner than using a marker file like MERGE_HEAD
at first sight, I do not think it is a wise thing to do in the long run.

You can only express two pieces of information (the overall "category of
state" by which funny ref/ hierarchy HEAD points at, and one object name
by storing it in the ref pointed at by HEAD), and if you need more (such
as MERGE_MSG that stores pre-packaged log message pieces is used during a
merge, in addition to MERGE_HEAD), you would need to use more than just
the "cute HEAD" trick to store them *anyway*.  Which means that it is a
bad tradeoff to use "cute HEAD" --- it closes the possibility to detect
user error to point HEAD at an incorrect place and I do not see the
benefit of "cute HEAD" outweigh the downside.

  reply	other threads:[~2009-02-13  9:06 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-02-12  8:09 [topgit] tg update error Aneesh Kumar
2009-02-12  8:48 ` martin f krafft
2009-02-12  9:25   ` Aneesh Kumar K.V
2009-02-12  9:32     ` martin f krafft
2009-02-12 10:12       ` Aneesh Kumar K.V
2009-02-12 11:29       ` Bert Wesarg
2009-02-12 12:56     ` Jeff King
2009-02-12 12:59       ` Jeff King
2009-02-12 21:01         ` martin f krafft
2009-02-12 21:01       ` Junio C Hamano
2009-02-12 21:41         ` martin f krafft
2009-02-12 23:14           ` Junio C Hamano
2009-02-13  6:28             ` martin f krafft
2009-02-13  7:32               ` Junio C Hamano
2009-02-13  9:04                 ` Junio C Hamano [this message]
2009-02-13 18:26         ` Jeff King
2009-02-14  2:02           ` Junio C Hamano
2009-02-14  2:08             ` Jeff King
2009-02-14  2:16               ` Junio C Hamano
2009-02-14  2:24                 ` Jeff King

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=7v63jebtdb.fsf@gitster.siamese.dyndns.org \
    --to=gitster@pobox$(echo .)com \
    --cc=aneesh.kumar@gmail$(echo .)com \
    --cc=aneesh.kumar@linux$(echo .)vnet.ibm.com \
    --cc=git@vger$(echo .)kernel.org \
    --cc=madduck@debian$(echo .)org \
    --cc=pasky@suse$(echo .)cz \
    --cc=peff@peff$(echo .)net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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