git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Steve Bennett <stevage@gmail.com>
To: Victor Engmark <victor.engmark@gmail.com>
Cc: git <git@vger.kernel.org>
Subject: Re: Bug (or inconsistency) in git add
Date: Mon, 30 Apr 2012 16:46:20 +1000	[thread overview]
Message-ID: <CADJEhEXtDZGav1Y5epZQ69NWptyVyPC1hmN6=YaNYrg3vYmBqg@mail.gmail.com> (raw)
In-Reply-To: <CAA5Ydx9h6o=uppRk5zc9V4z1S831KGVRBzTw9oMqDjY34-noOw@mail.gmail.com>

On 30 April 2012 16:23, Victor Engmark <victor.engmark@gmail.com> wrote:
> I can't answer for the absence of an error when no files are added, but
> globbing (resolving * in paths) is done by the shell, not by git. To verify
> a glob, just echo it:
>
> echo foo/**/*.py

Yes, it appears that the two cases are treated differently:
1) foo/**/*.py:  the shell expands the **, and interprets it the same
as "*",  so foo/**/*.py means any python file exactly one directory
deeper than foo
2) /**.py: the shell ignores this and passes it straight to Git.

So I guess the missing error message I reported originally is
logically correct in a kind of convoluted way: the ** is actually
matching real files (just not the ones you expected) and they don't
have any changes, so you don't get any output.

(Whether or not it makes sense for Git to produce identical output in
the case of both adding files with changes, and doing nothing at all,
is a debate I probably shouldn't start...)

> If you want to add recursively, you'll need to enable the special behavior
> for double stars:
>
> shopt -s globstar

Looks like I need a newer version of Bash.

In any case, it looks like Git does support some ** globbing natively.
I'm curious about the rules for that. They don't seem to be documented
in the git man page (http://schacon.github.com/git/user-manual.html).

Steve

  parent reply	other threads:[~2012-04-30  6:46 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CADJEhEWC=mMManxi9Q6W9EvVKmTV=i1ZxbdW4QS_ou_DrBEb+Q@mail.gmail.com>
2012-04-30  4:03 ` Bug (or inconsistency) in git add Steve Bennett
     [not found]   ` <CAA5Ydx9h6o=uppRk5zc9V4z1S831KGVRBzTw9oMqDjY34-noOw@mail.gmail.com>
2012-04-30  6:46     ` Steve Bennett [this message]
2012-04-30  7:02       ` Junio C Hamano

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='CADJEhEXtDZGav1Y5epZQ69NWptyVyPC1hmN6=YaNYrg3vYmBqg@mail.gmail.com' \
    --to=stevage@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=victor.engmark@gmail.com \
    /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).