git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Aguilar <davvid@gmail.com>
To: Jon Seymour <jon.seymour@gmail.com>
Cc: Junio C Hamano <gitster@pobox.com>,
	Jakub Narebski <jnareb@gmail.com>,
	Git Mailing List <git@vger.kernel.org>
Subject: Re: git-ls-files --added?
Date: Fri, 29 May 2009 14:26:42 -0700	[thread overview]
Message-ID: <20090529212634.GA86167@gmail.com> (raw)
In-Reply-To: <2cfc40320905251756t32e092fdqda769e21669f5d86@mail.gmail.com>

On Tue, May 26, 2009 at 10:56:52AM +1000, Jon Seymour wrote:
> Thanks for your answer's Junio.
> 
> I am indeed writing some porcelain. I currently have some bash tooling


I know that for the purposes of writing scripts it would be
really great if we had a plumbing command that gave us exactly
what git-status tells us, but in a machine-parseable
and stable output format.

Particularly tricky to get both correct and fast is
partially-staged files, but git-status gets it right.
By partially staged I mean it has new uncommitted content
in the index as well as even newer content in the worktree.

Files fall roughly into these categories:

1. Staged:
	1.1 Existing file
	1.2 New file
	1.3 Deleted file
	1.4 File was renamed, this is the old path
	1.5 File was renamed, this is the new path


2. Unmerged

3. Modified
	3.1 File was modified
	3.2 File was deleted

4. Untracked
	4.1 This is a file
	4.2 This is a directory


Here's some semantics I would expect from such a command:

- A file can be both staged and modified.

- A file that is unmerged is only unmerged.
  It is neither modified nor staged.

- Untracked path behavior is nicer with git-status then with
  git-ls-files, the reason being that status special-cases
  directories.


Getting all of this information quickly (without having to run
multiple commands) would be ideal.  This command is a
combination of diff-against-worktree, diff-against-index,
show-untracked-files, etc. so it's not a paradigm that's
easily constructed with the existing plumbing.


-- 
		David

  reply	other threads:[~2009-05-29 21:26 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-05-24  7:54 git-ls-files --added? Jon Seymour
2009-05-24  8:37 ` Jakub Narebski
2009-05-24  9:12   ` Jon Seymour
2009-05-24 18:17     ` Junio C Hamano
2009-05-25  6:33       ` Junio C Hamano
2009-05-25  7:31         ` Constantine Plotnikov
2009-05-25  7:46           ` Björn Steinbrink
2009-05-26  0:56         ` Jon Seymour
2009-05-29 21:26           ` David Aguilar [this message]
2009-05-29 22:01             ` Nanako Shiraishi
2009-05-29 23:06               ` Junio C Hamano
2009-05-30  6:02                 ` David Aguilar
2009-05-31 16:19                   ` Tony Finch

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=20090529212634.GA86167@gmail.com \
    --to=davvid@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=jnareb@gmail.com \
    --cc=jon.seymour@gmail.com \
    /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;
as well as URLs for NNTP newsgroup(s).