Re: [RFC] git-am: handling unborn branches

2015-06-05 Thread Junio C Hamano
Paul Tan writes: > Hmm, thinking about it, the equivalent C code would be greatly > affected by whatever behavior we go with, so I think we should try > fixing the behavior first. I am glad to see that sometimes people see the light when I say one of the greatest strength in scripted Porcelains

Re: [RFC] git-am: handling unborn branches

2015-06-05 Thread Paul Tan
On Fri, Jun 5, 2015 at 11:36 PM, Junio C Hamano wrote: > Paul Tan writes: > >> Hmm, actually git-am.sh doesn't seem to do that even when we have a >> history to apply patches to. This is okay in the non-3way case, as >> git-apply will check to see if the patch applies before it modifies >> the in

Re: [RFC] git-am: handling unborn branches

2015-06-05 Thread Junio C Hamano
Paul Tan writes: > Hmm, actually git-am.sh doesn't seem to do that even when we have a > history to apply patches to. This is okay in the non-3way case, as > git-apply will check to see if the patch applies before it modifies > the index, but if we fall back on 3-way merge, any new files the > fa

Re: [RFC] git-am: handling unborn branches

2015-06-05 Thread Paul Tan
On Fri, Jun 5, 2015 at 1:27 AM, Stefan Beller wrote: > On Thu, Jun 4, 2015 at 3:34 AM, Paul Tan wrote: >> Or, the current behavior of git-am.sh will print some scary errors >> about the missing HEAD, but will then continue on to the next patch. >> If the index is not clean, it will then error out

Re: [RFC] git-am: handling unborn branches

2015-06-04 Thread Paul Tan
On Fri, Jun 5, 2015 at 1:26 AM, Junio C Hamano wrote: > Paul Tan writes: > >> git-am generally supports applying patches to unborn branches. >> However, there are 2 cases where git-am does not handle unborn >> branches which I would like to address before the git-am rewrite to C: > >> 1. am --ski

Re: [RFC] git-am: handling unborn branches

2015-06-04 Thread Stefan Beller
On Thu, Jun 4, 2015 at 3:34 AM, Paul Tan wrote: > Hi, > > git-am generally supports applying patches to unborn branches. > However, there are 2 cases where git-am does not handle unborn > branches which I would like to address before the git-am rewrite to C: > > 1. am --skip > > For git am --skip,

Re: [RFC] git-am: handling unborn branches

2015-06-04 Thread Junio C Hamano
Paul Tan writes: > git-am generally supports applying patches to unborn branches. > However, there are 2 cases where git-am does not handle unborn > branches which I would like to address before the git-am rewrite to C: > 1. am --skip > > For git am --skip, git-am.sh does a fast-forward checkout

[RFC] git-am: handling unborn branches

2015-06-04 Thread Paul Tan
Hi, git-am generally supports applying patches to unborn branches. However, there are 2 cases where git-am does not handle unborn branches which I would like to address before the git-am rewrite to C: 1. am --skip For git am --skip, git-am.sh does a fast-forward checkout from HEAD to HEAD, disca