git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Git archiving only branch work

From
Jeff King <peff@peff.net>
Date
Nov 14, 2014, 15:32 UTC
Message-ID
<20141114153222.GA23077@peff.net>
In-Reply-To
<xmqq61eizs9v.fsf@gitster.dls.corp.google.com>
On Thu, Nov 13, 2014 at 01:48:12PM -0800, Junio C Hamano wrote:
Show 10 quoted lines
> Jeff King <peff@peff.net> writes:
> 
> > 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.
> 
> You do not have to generate, i.e. you should be allowed to do this:
> 
>     $ git cmd --stdin -z <list-of-patterns

Right. My point is that I am not sure anybody ever really _wants_ to do this, versus:

  git cmd -- "$pattern1" "$pattern2"

Because patterns tend to be small in number and made with predictable characters known to the script writer. It is sets of arbitrary filenames that tend to be long and contain random junk.

> And this is not about "flexibility".  Unless your plan is to forbid
> a corner case you do not anticipate and always disable pathspec
> globbing, you would need to say something like:

I had just assumed we would forbid, but yeah, you could have a switch to handle either case. That is much nicer to the corner case people.

Show 5 quoted lines
> Which is awkward.  And "--stdin -z" is most likely used in scripts;
> we are not forcing people to keep typing --literal-pathspecs by
> leaving them orthogonal *and* people do not have to remember one
> more exception (the default of --literal-pathspecs is flipped only
> when --stdin -z is in use) to the rule.

It is not about "forcing to type". It is about "did not realize this was a potential pitfall and did not write it in the script in the first place".

-Peff
Previous: Junio C HamanoNext: Junio C Hamano
Message 11 of 13 in “Git archiving only branch work”
  1. Graeme GeldenhuysNov 13, 2014
  2. Peter KreftingNov 13, 2014
  3. Duy NguyenNov 13, 2014
  4. Junio C HamanoNov 13, 2014
  5. Jeff KingNov 13, 2014
  6. Junio C HamanoNov 13, 2014
  7. Jeff KingNov 13, 2014
  8. Junio C HamanoNov 13, 2014
  9. Jeff KingNov 13, 2014
  10. Junio C HamanoNov 13, 2014
  11. Jeff KingNov 14, 2014
  12. Junio C HamanoNov 14, 2014
  13. Thomas KochNov 13, 2014

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.