I know ls-files is the tool I need but I haven't been able to figure out what combination of options will give me the files that have been added to the index.
-Kate
threads / discuss / 14148
Subject: how to list all files that will be comitted
I know ls-files is the tool I need but I haven't been able to figure out what combination of options will give me the files that have been added to the index.
-Kate
Re: how to list all files that will be comitted
On Wed, 25 Jun 2008 at 11:31am -0400, Rhodes, Kate wrote:
> I know ls-files is the tool I need but I haven't been able to figure out what > combination of options will give me the files that have been added to the > index. > > -Kate
Have you tried "git status" ? It will output something similar to the following:
# On branch master # Changes to be committed: # (use "git reset HEAD <file>..." to unstage) # # modified: somefile # # Changed but not updated: # (use "git add <file>..." to update what will be committed) # # modified: anotherfile #
-- Ian Hilt Ian.Hilt (at) gmx.com GnuPG key: 0x4AFC1EE3
Re: how to list all files that will be comitted
yeah, but i was hoping for plumbing, not porcelain, that showed just what i wanted so that i didn't have to parse status' output.
-Kate
On Jun 25, 2008, at 11:57 AM, Ian Hilt wrote:
> Have you tried "git status" ? It will output something similar to the > following:
Re: how to list all files that will be comitted
On 2008-06-25 12:01:49 -0400, Rhodes, Kate wrote:
> yeah, but i was hoping for plumbing, not porcelain, that showed just > what i wanted so that i didn't have to parse status' output.
Unless you want a listing of all the files in the index, you probably want to call diff-index.
git diff-index --cached <tree-ish>
gives you the diff between the index and a tree-ish. With the --name-only option, you get only the filenames and not all the modes, blob sha1s, etc.
--
Karl Hasselström, kha@treskal.com
www.treskal.com/kalleRe: how to list all files that will be comitted
Perfect, exactly what I wanted. Thanks.
-Kate
On Jun 25, 2008, at 12:14 PM, Karl Hasselström wrote:
> On 2008-06-25 12:01:49 -0400, Rhodes, Kate wrote: > >> yeah, but i was hoping for plumbing, not porcelain, that showed just >> what i wanted so that i didn't have to parse status' output. > > Unless you want a listing of all the files in the index, you probably > want to call diff-index. > > git diff-index --cached <tree-ish> > > gives you the diff between the index and a tree-ish. With the > --name-only option, you get only the filenames and not all the modes, > blob sha1s, etc. > > -- > Karl Hasselström, kha@treskal.com > www.treskal.com/kalle
Re: how to list all files that will be comitted
On Wed, 25 Jun 2008 at 12:01pm -0400, Rhodes, Kate wrote:
> yeah, but i was hoping for plumbing, not porcelain, that showed just what i > wanted so that i didn't have to parse status' output.
I wasn't able to make "git ls-files" do what you want. However, "git diff --name-only --cached" did. It's still porcelain, but it does what you want :)
-- Ian Hilt Ian.Hilt (at) gmx.com GnuPG key: 0x4AFC1EE3
Re: how to list all files that will be comitted
2008/6/25 Rhodes, Kate <masukomi@gmail.com>:
> I know ls-files is the tool I need but I haven't been able to figure out > what combination of options will give me the files that have been added to > the index. > > -Kate
`git status` will do this, unless you need to do additional processing on the results.
HTH, - Reece
Re: how to list all files that will be comitted
Rhodes, Kate venit, vidit, dixit 25.06.2008 17:31:
> I know ls-files is the tool I need but I haven't been able to figure > out what combination of options will give me the files that have been > added to the index.
I don't think git ls-files does that, but
git diff --cached --name-only
will.
Cheers, Michael