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

Re: [Qgit RFC] commit --amend

From
JHJan Hudec <bulb@ucw.cz>
Date
Jul 2, 2007, 18:03 UTC
Message-ID
<20070702180309.GA4400@efreet.light.src>
In-Reply-To
<e5bfff550707010909p4eba184ekff2025fb158a4aee@mail.gmail.com>
On Sun, Jul 01, 2007 at 18:09:37 +0200, Marco Costalba wrote:
Show 12 quoted lines
> [...]
> QGit::run() and QGit::runAsync()
> [...]
>
> A bool is the only flag returned, because error detect is done at
> lower level, in MyProcess::sendErrorMsg() in file myprocess.cpp that
> handles the low level of running an external process and is called by
> run().
>
> In case of an error MyProcess::sendErrorMsg() is called to inform the
> GUI (a popup dialog box) about the error and the stderr output
> received.

Thanks. That's the bit I didn't see in MyProcess. Ok, so I'll simply return from the function when some of the run()s return false.

> [...]
> Hope this helps.
Thanks.
> P.S: Why 'git-commit --amend -F' it's explicitely forbidden?

The logic for preparing the commit message seems to be incompatible in git-commit.sh for some reason and whoever wrote it fobode those flags together instead of making it compatible. In any case, the error is reported in git-commit.sh:291-296:

case "$log_given" in
tt*)
	die "Only one of -c/-C/-F/--amend can be used." ;;
*tm*|*mt*)
	die "Option -m cannot be combined with -c/-C/-F/--amend." ;;
esac
And in any case the git policy is, that frontends should not be using
porcelain commands. What I would really like to see is something between
git-commit and git-commit-tree, that would:
 - run pre-commit hook
 - write-tree
 - commit-tree
 - update-ref
 - rerere
 - run post-commit hook
But it does not exist and git-gui obviously does that manually, so I did it
manually as well. Now I have to test it.

The other thing that didn't work (or at least from reading the code it seems it couldn't) is commiting merges, because when commiting merge, filename arguments are forbidden on git-commit.

Commiting merges will require some special handling, because you have to at least commit all files that were merged. And you can't re-create pristine index with read-tree the way normal commit does it either.

Unfortunately I don't fully understand -- and remember the right commands for working with it -- the multi-stage index.

-- 
						 Jan 'Bulb' Hudec <bulb@ucw.cz>
Previous: Marco CostalbaNext: Junio C Hamano
Message 8 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.