Re: [RFC/PATCH] replace: add --graft option

2014-05-22 Thread Christian Couder
From: Michael Haggerty > On 05/18/2014 08:29 PM, Christian Couder wrote: >> The usage string for this option is: >> >> git replace [-f] --graft [...] >> >> First we create a new commit that is the same as >> except that its parents are [...] >> >> Then we create a replace ref that replace w

Re: [RFC/PATCH] replace: add --graft option

2014-05-19 Thread Junio C Hamano
Jeff King writes: > On Mon, May 19, 2014 at 10:25:10AM -0700, Junio C Hamano wrote: > >> The headers up to committer are cast in stone in their ordering, and >> I do not immediately see how loosening it would be beneficial. >> >> Unless you are trying to give users a new way to record exactly th

Re: [RFC/PATCH] replace: add --graft option

2014-05-19 Thread Jeff King
On Mon, May 19, 2014 at 10:25:10AM -0700, Junio C Hamano wrote: > Jeff King writes: > > > It might make sense to just teach parse_commit_header to be a little > > more thorough; it has to read past those lines anyway to find the author > > and committer lines, so it would not be much more expens

Re: [RFC/PATCH] replace: add --graft option

2014-05-19 Thread Junio C Hamano
Jeff King writes: > It might make sense to just teach parse_commit_header to be a little > more thorough; it has to read past those lines anyway to find the author > and committer lines, so it would not be much more expensive to note > them. And then of course the code needs to be pulled out of

Re: [RFC/PATCH] replace: add --graft option

2014-05-19 Thread Jeff King
On Sun, May 18, 2014 at 08:29:38PM +0200, Christian Couder wrote: > +static int create_graft(int argc, const char **argv, int force) > +{ > + unsigned char old[20], new[20]; > + const char *old_ref = argv[0]; > + struct strbuf buf = STRBUF_INIT; > + struct strbuf new_parents = STRB

Re: [RFC/PATCH] replace: add --graft option

2014-05-19 Thread Jeff King
On Mon, May 19, 2014 at 11:42:07AM +0200, Michael Haggerty wrote: > On 05/18/2014 08:29 PM, Christian Couder wrote: > > The usage string for this option is: > > > > git replace [-f] --graft [...] > > > > First we create a new commit that is the same as > > except that its parents are [...] > >

Re: [RFC/PATCH] replace: add --graft option

2014-05-19 Thread Michael Haggerty
On 05/18/2014 08:29 PM, Christian Couder wrote: > The usage string for this option is: > > git replace [-f] --graft [...] > > First we create a new commit that is the same as > except that its parents are [...] > > Then we create a replace ref that replace with > the commit we just created. >

[RFC/PATCH] replace: add --graft option

2014-05-18 Thread Christian Couder
The usage string for this option is: git replace [-f] --graft [...] First we create a new commit that is the same as except that its parents are [...] Then we create a replace ref that replace with the commit we just created. With this new option, it should be straightforward to convert graf