Duy Nguyen <pclo...@gmail.com> wrote:

> ... it's not easy to determine ambiguity here, especially when the
> repo finding code does not know anything about "bar/barz.c" (is it
> a pathname or an argument to an option?).

IOW, the code that finds the repository is called "too early"?

One way to solve that to that would be to proceed, even if the
repository has to be left as "unknown" until it actually needs to
be consulted -- by which time the subcommand would presumably have
parsed all of the options and pathnames and so would know which is
which.  Then, use the pathname(s) to identify the repository(ies).
Yes, if there's more than one repository involved, the subcommand
has to do a "for each repository" loop.  The code to do all this
could go in a module shared among the subcommands.

> There are more cases to consider, like what if you do
> "git rm bar/baz.c and rab/zab.c" where bar and rab are
> two different repositories..

So we remove baz.c from bar and zab.c from rab.  It's not clear
to me that there's anything wrong with that -- it's exactly what
I would expect to have happen (and also what the hackish script
I posted will do).
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to