Re: [Qgit RFC] commit --amend

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Jan Hudec
Date: Wednesday, July 4, 2007 - 11:28 am

On Wed, Jul 04, 2007 at 14:44:16 +0200, Marco Costalba wrote:

I would prefer if there was something between git-commit-tree and git-commi=
t.
There are several steps one has to do for commit, that are the same for most
ways of commit:
 - call pre-commit hook (unless --no-verify)
 - write-tree
 - commit-tree
 - update-ref
 - mv next-index index
 - call post-commit hook (unless --no-verify or unconditionally?)

Would factoring out such script from the end of git-commit.sh be accepted?

Or would it be possible to get just that from git-commit with right options?
Basically I need to replicate the logic with=20

I would suggest a name git-commit-index. It would take the index to commit,
index to move in after commit, head to update, list of parents and commit
message on standard input (as commit-tree does).

The other thing is, that of course qgit (or any other frontend) can't start
using it until it's accepted and released with git. So I'll first try to get
it working in qgit and than think about making it a separate plumbing comma=
nd
in git.

e:

Definitely.


Actually, no. The porcelains are more likely to change than the plumbing.


I actually am, because I am rewriting it to use plumbing, which means
git-write-tree and git-commit-tree directly. And git-commit-tree always rea=
ds
commit message from stdin.

=20

=2E.. except if I read the code correctly, it will create a temporary file
anyway. The comment in QGit::startProcess says it is because of windows, but
there is nothing to disable it in Unix, so to me it seems temporary file is
used anyway.


The old code needs rewriting in any case, because if I read it correctly, it
will not commit merges either. Yes, you rarely do it, because git
automatically commits non-conflicting merges, but amending such commits is
much more common.

I would personally most like qgit to do all playing with index on it's own
and than call a single command to commit the index. But commit can't really
do that, because I can't give commit the parent list and I don't like the
idea of reset --soft HEAD^ + reinstate whatever MERGE_HEAD there needs to be
(to not clutter reflog and also to leave the tree is as sensible state as
possible if something goes wrong).

--=20
						 Jan 'Bulb' Hudec <bulb@ucw.cz>
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: [Qgit RFC] commit --amend, Junio C Hamano, (Tue Jul 3, 10:10 pm)
Re: [Qgit RFC] commit --amend, Marco Costalba, (Wed Jul 4, 5:44 am)
Re: [Qgit RFC] commit --amend, Jan Hudec, (Wed Jul 4, 11:28 am)
Re: [Qgit RFC] commit --amend, Junio C Hamano, (Wed Jul 4, 12:51 pm)
Re: [Qgit RFC] commit --amend, Marco Costalba, (Fri Jul 6, 12:54 am)