Re: [PATCH v6 02/10] replace: add --graft option

2014-07-11 Thread Christian Couder
On Thu, Jul 10, 2014 at 7:36 PM, Junio C Hamano gits...@pobox.com wrote: Junio C Hamano gits...@pobox.com writes: As the user might expect that a new replace ref was created on success (0 exit code), and as we should at least warn if we would create a commit that is the same as an existing

Re: [PATCH v6 02/10] replace: add --graft option

2014-07-11 Thread Junio C Hamano
Christian Couder christian.cou...@gmail.com writes: On Thu, Jul 10, 2014 at 7:36 PM, Junio C Hamano gits...@pobox.com wrote: Making sure A's parent is B would be an idempotent operation, no? Why not just make sure A's parent is already B and report Your wish has been granted to the user?

Re: [PATCH v6 02/10] replace: add --graft option

2014-07-11 Thread Christian Couder
On Fri, Jul 11, 2014 at 4:22 PM, Junio C Hamano gits...@pobox.com wrote: Christian Couder christian.cou...@gmail.com writes: On Thu, Jul 10, 2014 at 7:36 PM, Junio C Hamano gits...@pobox.com wrote: Making sure A's parent is B would be an idempotent operation, no? Why not just make sure A's

Re: [PATCH v6 02/10] replace: add --graft option

2014-07-11 Thread Junio C Hamano
Christian Couder christian.cou...@gmail.com writes: On Fri, Jul 11, 2014 at 4:22 PM, Junio C Hamano gits...@pobox.com wrote: Christian Couder christian.cou...@gmail.com writes: On Thu, Jul 10, 2014 at 7:36 PM, Junio C Hamano gits...@pobox.com wrote: Making sure A's parent is B would be an

Re: [PATCH v6 02/10] replace: add --graft option

2014-07-11 Thread Jeff King
On Fri, Jul 11, 2014 at 11:25:43AM -0700, Junio C Hamano wrote: Christian Couder christian.cou...@gmail.com writes: On Fri, Jul 11, 2014 at 4:22 PM, Junio C Hamano gits...@pobox.com wrote: Christian Couder christian.cou...@gmail.com writes: On Thu, Jul 10, 2014 at 7:36 PM, Junio C

Re: [PATCH v6 02/10] replace: add --graft option

2014-07-10 Thread Christian Couder
On Wed, Jul 9, 2014 at 4:59 PM, Junio C Hamano gits...@pobox.com wrote: Christian Couder chrisc...@tuxfamily.org writes: +static void replace_parents(struct strbuf *buf, int argc, const char **argv) +{ + struct strbuf new_parents = STRBUF_INIT; + const char *parent_start,

Re: [PATCH v6 02/10] replace: add --graft option

2014-07-10 Thread Junio C Hamano
Christian Couder christian.cou...@gmail.com writes: Is this really an error? It may be a warning-worthy situation for a user or a script to end up doing a no-op graft, e.g. git replace --graft HEAD HEAD^ but I wonder if it is more convenient to signal an error (like this patch

Re: [PATCH v6 02/10] replace: add --graft option

2014-07-10 Thread Junio C Hamano
Junio C Hamano gits...@pobox.com writes: Christian Couder christian.cou...@gmail.com writes: Is this really an error? It may be a warning-worthy situation for a user or a script to end up doing a no-op graft, e.g. git replace --graft HEAD HEAD^ but I wonder if it is more

Re: [PATCH v6 02/10] replace: add --graft option

2014-07-09 Thread Junio C Hamano
Christian Couder chrisc...@tuxfamily.org writes: The usage string for this option is: git replace [-f] --graft commit [parent...] First we create a new commit that is the same as commit except that its parents are [parents...] Then we create a replace ref that replace commit with the