Git development
 help / color / mirror / Atom feed
From: Jonas Bernoulli <jonas@bernoul.li>
To: git@vger.kernel.org
Subject: GIT_WORK_TREE=dir git ls-files --deleted
Date: Tue, 17 Mar 2009 02:41:50 +0100	[thread overview]
Message-ID: <201bac3a0903161841y6bc59fe5iaf0c221c08db5f43@mail.gmail.com> (raw)

Hello

git ls-files --deleted seams to be broken when GIT_WORK_TREE is set as
can be observed below.

Instead of just showing deleted files it also shows at least unchanged
and modified files.

I have observed this behaviour with git.git and do not know if
released versions are affected.

#### setup

$ mkdir -p base/worktree
$ cd base/
$ export GIT_DIR=/tmp/base/.git
$ export GIT_WORK_TREE=/tmp/base/worktree
$ git init
Initialized empty Git repository in /tmp/base/.git/
$ touch worktree/deleted worktree/modified worktree/unchanged
$ git add .
$ git commit -m init
[master (root-commit) f4e1bd3] init
 0 files changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 deleted
 create mode 100644 modified
 create mode 100644 unchanged
$ rm worktree/deleted
$ echo modified > worktree/modified

#### expected result

$ git ls-files --deleted
deleted

#### actual result

$ git ls-files --deleted
deleted
modified
unchanged

#### untracked and out-of-worktree seam to be fine

$ touch worktree/untracked
$ touch not-in-worktree
$ git ls-files --deleted
deleted
modified
unchanged

#### related options / commands seam to be fine

$ git ls-files --modified
deleted
modified
$ git ls-files --others
$ git ls-files --cached
deleted
modified
unchanged
$ git status
# 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)
#
#       deleted:    deleted
#       modified:   modified
#
no changes added to commit (use "git add" and/or "git commit -a")

Best regards,

-- Jonas Bernoulli

Ps: Is there a way to show modified files excluding deleted files
other than this?
( git ls-files --deleted; git ls-files --modified ) | uniq --unique
Pps: The description of --others is ambitious, what is "other files"?

             reply	other threads:[~2009-03-17  1:43 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-17  1:41 Jonas Bernoulli [this message]
2009-03-17  9:03 ` GIT_WORK_TREE=dir git ls-files --deleted Jeff King

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=201bac3a0903161841y6bc59fe5iaf0c221c08db5f43@mail.gmail.com \
    --to=jonas@bernoul.li \
    --cc=git@vger.kernel.org \
    /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