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

Re: Bug(feature?) on git-diff-files

From
NRNoName Req <nonamereq29@gmail.com>
Date
Apr 12, 2019, 12:41 UTC
Message-ID
<CABgj7uu95Pg7jJY1CN7kUS-SWE6+FCgQshuzWWRrhMqBd_zMMA@mail.gmail.com>
In-Reply-To
<CACsJy8B0dmonaCuAmT6wNJae8iX0JxUOvU-P=zvjVUrQnoHoUw@mail.gmail.com>

Okay thanks for the reply. I didn't know about git update-index will try that now.

On Thu, Apr 11, 2019 at 3:57 PM Duy Nguyen <pclouds@gmail.com> wrote:
Show 35 quoted lines
>
> On Thu, Apr 11, 2019 at 7:49 PM NoName Req <nonamereq29@gmail.com> wrote:
> >
> > Summary
> >    `git -C (folder path) diff-files --name-only` output is not correct
> >
> > Steps to Reproduce
> > 1. Apply change to a clean git repository. Go to another folder (not
> > within this repository) and apply the command
> >    `git -C repo-path diff-files --name-only`
> > The above command lists dirty files in that repository.
> > 2. Now undo your changes on the repository
> > 3. Issue the same command. It still lists the file.
> >
> > More Information
> >
> > `git -C repo-path diff`  command doesn't seem to have this problem.
>
> I haven't tried to reproduce. But my first impression is diff-files,
> as a low-level plumbing sometimes requires you to refresh the index
> first. Sometimes without that, you'll get wrong output.
>
> "git diff" is a more high-level command that always refreshes the
> index internally.
>
> >
> > System Information
> >
> > Arch Linux 5.0.7-arch1-1-ARCH
> > git version 2.21.0
>
>
>
> --
> Duy
Previous: Duy Nguyen
Message 4 of 4 in “Bug(feature?) on git-diff-files”
  1. NoName ReqApr 11, 2019
  2. Jeff KingApr 11, 2019
  3. Duy NguyenApr 11, 2019
  4. NoName ReqApr 12, 2019

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.