git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [Qgit RFC] commit --amend

From
MCMarco Costalba <mcostalba@gmail.com>
Date
Jul 8, 2007, 13:49 UTC
Message-ID
<e5bfff550707080649r493616cw4bbf3396e059698d@mail.gmail.com>
In-Reply-To
<20070708133825.GE3991@efreet.light.src>
On 7/8/07, Jan Hudec <bulb@ucw.cz> wrote:
Show 33 quoted lines
> On Fri, Jul 06, 2007 at 10:12:50 +0200, Marco Costalba wrote:
> > On 7/5/07, Jan Hudec <bulb@ucw.cz> 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.
>

It it has "commit dialog" life span I would suggets to save in a "commit dialog" object member data.

Marco
Previous: Jan Hudec
Message 17 of 17 in “[Qgit RFC] commit --amend”
  1. Jan HudecJun 10, 2007
  2. Marco CostalbaJun 10, 2007
  3. Jan HudecJun 11, 2007
  4. Marco CostalbaJun 11, 2007
  5. Marco CostalbaJun 11, 2007
  6. Jan HudecJul 1, 2007
  7. Marco CostalbaJul 1, 2007
  8. Jan HudecJul 2, 2007
  9. Junio C HamanoJul 4, 2007
  10. Marco CostalbaJul 4, 2007
  11. Jan HudecJul 4, 2007
  12. Junio C HamanoJul 4, 2007
  13. Marco CostalbaJul 6, 2007
  14. Jan HudecJul 5, 2007
  15. Marco CostalbaJul 6, 2007
  16. Jan HudecJul 8, 2007
  17. Marco CostalbaJul 8, 2007

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.