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

From: Jan Hudec <[email-masked]>
Date: Mon, 2 Jul 2007 20:03:09 +0200

On Sun, Jul 01, 2007 at 18:09:37 +0200, Marco Costalba wrote:
> [...]
> 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 <[email-masked]>