Subject: Re: [Qgit RFC] commit --amend

From: Jan Hudec <[email-masked]>
Date: Sun, 8 Jul 2007 15:38:26 +0200

On Fri, Jul 06, 2007 at 10:12:50 +0200, Marco Costalba wrote:
> On 7/5/07, Jan Hudec <[email-masked]> wrote:
>> Therefore I'll either have to always ask git via run("git-rev-parse HEAD",
>> head), add HEAD into the map, or store HEAD somewhere in the Git object.
>> Which do you think makes most sense?
>
> Asking git when you need it and keep HEAD value only for the minimum
> time required to execute the commit command.
>
> - HEAD is very 'volatile'
>
> - commit is _not_ performance critical.
>
> - commit, being a write operation, is instead bugs/misbehaviour
> critical (a big point to use an high level "git-commit" BTW)
>
> - asking git with getRefSha("HEAD", ANY_REF, true)  is very quick and
> in any case much quicker then the whole commit dance.

Yes. It is also much faster to write in code, but...

> - someone can always change the repo behind you, qgit is not the only
> interface to git ;-) does exist also the command line.

And the commit in qgit should better fail loudly if that happens, because the
list of files or something else might no longer make sense.

There is actually just one thing I need the head for -- passing it as 3rd
argument to git-update-ref. That should be done purely as safety measure --
if the value does not match, the command will fail. And for that safety
measure to be useful, I need value of the head at the time user openend the
commit dialog, NOT the time user clicked on commit button.

-- 
						 Jan 'Bulb' Hudec <[email-masked]>