Re: Git archiving only branch work

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

Re: Git archiving only branch work

From: Junio C Hamano <hidden>
Date: 2016-06-15 23:02:56

Jeff King [off-list ref] writes:
On Thu, Nov 13, 2014 at 01:10:17PM -0800, Junio C Hamano wrote:
quoted
quoted
How about just adding --stdin, which matches other git commands?
How about doing nothing and use the correct $IFS instead?
Can you cover all cases with $IFS, including filenames with newlines?
You didn't say "--stdin -z", so I presume --stdin is not solving
anything ;-)
I agree it is probably OK in practice and for the OP's question, but it
is nice to have "-z" variants so you do not have to worry about quoting
at all. I'd argue that a "--stdin -z" should probably also accept raw
filenames, not pathspecs, too (so you do not have to use
"--literal-pathspecs" elsewhere).
I agree "--stdin -z" is a good thing but what makes you think that
the producer of the data is _always_ walking the directory hierarchy
and showing the pathnames it sees?  I think use of literal-pathspecs
should not be tied to the use of either --stdin or -z.

Re: Git archiving only branch work

From: Jeff King <hidden>
Date: 2016-06-15 23:02:56

On Thu, Nov 13, 2014 at 01:36:48PM -0800, Junio C Hamano wrote:
quoted
I agree it is probably OK in practice and for the OP's question, but it
is nice to have "-z" variants so you do not have to worry about quoting
at all. I'd argue that a "--stdin -z" should probably also accept raw
filenames, not pathspecs, too (so you do not have to use
"--literal-pathspecs" elsewhere).
I agree "--stdin -z" is a good thing but what makes you think that
the producer of the data is _always_ walking the directory hierarchy
and showing the pathnames it sees?  I think use of literal-pathspecs
should not be tied to the use of either --stdin or -z.
I agree they are technically orthogonal, but I cannot think of a case
where I have ever generated actual _pathspecs_, which might have
wildcards, and needed to use "-z". The point of using "-z" is that you
do not know what crap you are feeding.

Normally I'm in favor of keeping things as flexible as possible, but it
seems very likely that somebody would forget pathspecs in such a case
(the OP did in his example, and I know I have many times in the past).
I don't feel too strongly about it, though.

-Peff
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help