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

Re: ls-files -t broken? Or do I just not understand it?

From
Nguyen Thai Ngoc Duy <pclouds@gmail.com>
Date
Aug 19, 2009, 09:04 UTC
Message-ID
<fcaeb9bf0908190204h31bc839ai39972a251040d449@mail.gmail.com>
In-Reply-To
<vpqljlguqtn.fsf@bauges.imag.fr>
On Wed, Aug 19, 2009 at 3:54 PM, Matthieu Moy<Matthieu.Moy@imag.fr> wrote:
Show 36 quoted lines
> Björn Steinbrink <B.Steinbrink@gmx.de> writes:
>
>> Hi,
>>
>> ls-files -t seems to always show status H, even if the file was modified
>> or deleted, and thus gets shown by -m and -d respectively.
>
> That's not exactly "always", but I don't know whether it's the desired
> behavior:
>
> /tmp/git$ git st
> # On branch master
> # Changed but not updated:
> #   (use "git add/rm <file>..." to update what will be committed)
> #   (use "git checkout -- <file>..." to discard changes in working directory)
> #
> #       modified:   modified
> #       deleted:    removed
> #
> no changes added to commit (use "git add" and/or "git commit -a")
> /tmp/git$ git ls-files -t
> H modified
> H removed
> H unmodified
> /tmp/git$ git ls-files -t -m
> C modified
> C removed
> /tmp/git$ git ls-files -t -d
> R removed
> $ git ls-files -t -d -m
> C modified
> R removed
> C removed
>
> So, you get the C and R flags only when you request explicitely -m and
> -d.
Let's see how it goes without "-t":

pclouds@dektop /tmp/i $ git ls-files modified removed unmodified pclouds@dektop /tmp/i $ git ls-files -m modified removed pclouds@dektop /tmp/i $ git ls-files -d removed pclouds@dektop /tmp/i $ git ls-files -d -m modified removed removed

I'd say it's expected behavior.
-- 
Duy
Previous: Matthieu MoyNext: Björn Steinbrink
Message 3 of 7 in “ls-files -t broken? Or do I just not understand it?”
  1. Björn SteinbrinkAug 19, 2009
  2. Matthieu MoyAug 19, 2009
  3. Nguyen Thai Ngoc DuyAug 19, 2009
  4. Björn SteinbrinkAug 19, 2009
  5. Nguyen Thai Ngoc DuyAug 19, 2009
  6. Junio C HamanoAug 19, 2009
  7. Matthieu MoyAug 19, 2009

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.