Thread (16 messages) flat view 16 messages, 3 authors, 2016-06-15

Re: [Qgit RFC] commit --amend

From: Jan Hudec <hidden>
Date: 2016-06-15 22:43:20

On Fri, Jul 06, 2007 at 10:12:50 +0200, Marco Costalba wrote:
On 7/5/07, Jan Hudec [off-list ref] wrote:
quoted
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 [off-list ref]

Attachments

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help