From: Alex Riesen <raa.lkml@gmail.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>, git@vger.kernel.org
Subject: Re: [RFC] Making ce_path_match() more useful by accepting globs
Date: Mon, 26 Nov 2007 20:38:13 +0100 [thread overview]
Message-ID: <20071126193813.GB3675@steel.home> (raw)
In-Reply-To: <7vlk8lj1b7.fsf@gitster.siamese.dyndns.org>
Junio C Hamano, Mon, Nov 26, 2007 01:30:20 +0100:
> Alex Riesen <raa.lkml@gmail.com> writes:
>
> > Junio C Hamano, Sun, Nov 25, 2007 19:03:12 +0100:
> >> Currently ce_path_match() only uses "the leading directory" match, and
> >> does not understand file globs. These do not work:
> >>
> >> git diff-files 't/*.sh'
> >> git diff-index HEAD 'xdiff/*.c'
> >> git update-index -g 'Documentation/howto/*.txt'
> >
> > How should my scripts handle files with "*" in names?
>
> We DO NOT CARE.
>
> Why?
>
> How would you handle such files from the command line session without
> git? "ls such-*-a-file" will also show such-silly-a-file as well.
It will break existing setups. Something like
#!/bin/bash
git diff-files --quiet -- "$@" || do_something
will behave differently
> IOW, the user is shooting in the foot --- and at that point I am not all
> that interested in helping him.
What with? What's wrong with a name like "M*A*S*H" in your personal IMDB?
> Having said that, I would think that quoting the meta from fnmatch(3)
> like this:
>
> git ls-files 'such-\*-a-file'
>
> would work fine, just like
>
> ls such-\*-a-file
>
> would.
An existing system will still be broken.
> If "ls such-*-a-file" reports only one file,
>
> git ls-files 'such-*-a-file'
>
> would also report that file as well.
>
> So in practice I do not see a problem.
I think I do. There is NO way to pass the filenames to git plumbing
(only the diff-, or is git update-index --stdin -z also subject to
glob expansion?) without being sure they are exactly they were on
filesystem. Quoting is just PITA for scripting.
prev parent reply other threads:[~2007-11-26 19:38 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-11-25 18:03 [RFC] Making ce_path_match() more useful by accepting globs Junio C Hamano
2007-11-26 0:11 ` Alex Riesen
2007-11-26 0:30 ` Junio C Hamano
2007-11-26 0:48 ` Junio C Hamano
2007-11-26 19:38 ` Alex Riesen [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20071126193813.GB3675@steel.home \
--to=raa.lkml@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=torvalds@linux-foundation.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).