Re: Git issues with submodules
- From
Jeff King <peff@peff.net>
- Date
- Nov 22, 2013, 15:11 UTC
- Message-ID
- <20131122151120.GA32361@sigill.intra.peff.net>
- In-Reply-To
- <CALkWK0nDME-z7G4kcag=ad3qH5FL9FawrYFyVLQB6Z_g+TV+vQ@mail.gmail.com>
On Fri, Nov 22, 2013 at 06:38:47PM +0530, Ramkumar Ramachandra wrote:
Show 11 quoted lines
> >> Does Arcanist use `git ls-files -m` to check? > > > > Yes, Arcanist uses `git ls-files -m` to check whether there're local > > modifications. We might also contact phab developers asking to change > > it to `git diff --name-only HEAD --`. Is there a preferable way to > > get list of modified files and are this command intended to output the > > same results? > > I just checked it out: it uses `git ls-files -m` to get the list of > unstaged changes; `git diff --name-only HEAD --` will list staged > changes as well.
That diff command compares the working tree and HEAD; if you are trying to match `ls-files -m`, you probably wanted just `git diff --name-only` to compare the working tree and the index. Although in a script you'd probably want to use the plumbing `git diff-files` instead.
-Peff