Re: [PATCH v1 1/3] replace: add --graft option

2 messages, 2 authors, 2016-06-15 · open the first message on its own page

Re: [PATCH v1 1/3] replace: add --graft option

From: Junio C Hamano <hidden>
Date: 2016-06-15 23:01:22

Jeff King [off-list ref] writes:
On Fri, May 23, 2014 at 01:05:40PM -0700, Junio C Hamano wrote:
quoted
I just read read_graft_line(); it allows an empty line (both
length-0 before the terminating LF or CRLF, and a line with
isspace() only) and ignore them, so "grep '^[^#]'" is not
sufficient.
Thanks, I missed the space trimming. I think:

  grep '^[^# \t]'

would be enough, though I am not sure that "\t" is portable over a raw
tab.
Perhaps.  That would filter out an empty line as well, which would
be good.
quoted
Perhaps a more future-proof way to write Christian's code may be:
...
which may not be too bad.
Sounds familiar:

  http://article.gmane.org/gmane.comp.version-control.git/249575
Yup, instead of having to memmove() repeatedly, copying into it
while skipping 'parent ' lines may be better.

Re: [PATCH v1 1/3] replace: add --graft option

From: Eric Sunshine <hidden>
Date: 2016-06-15 23:01:22

On Fri, May 23, 2014 at 5:22 PM, Junio C Hamano [off-list ref] wrote:
Jeff King [off-list ref] writes:
quoted
On Fri, May 23, 2014 at 01:05:40PM -0700, Junio C Hamano wrote:
quoted
I just read read_graft_line(); it allows an empty line (both
length-0 before the terminating LF or CRLF, and a line with
isspace() only) and ignore them, so "grep '^[^#]'" is not
sufficient.
Thanks, I missed the space trimming. I think:

  grep '^[^# \t]'

would be enough, though I am not sure that "\t" is portable over a raw
tab.
'grep' does not recognize "\t" on BSD or derivatives, such as Mac OS
X. (Nor does 'sed'.)
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help