public inbox for git@vger.kernel.org 
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox•com>
To: Michael Toy <michael@toyland•org>
Cc: git@vger•kernel.org
Subject: Re: git-status -- trying to understand all possible states
Date: Tue, 01 Apr 2014 14:37:52 -0700	[thread overview]
Message-ID: <xmqq4n2czq6n.fsf@gitster.dls.corp.google.com> (raw)
In-Reply-To: <4AF06B83-E928-4FE2-8094-F23CE3BA1EBC@toyland.org> (Michael Toy's message of "Tue, 1 Apr 2014 13:07:33 -0700")

Michael Toy <michael@toyland•org> writes:

> Of the 24 possibilities (not counting ignored) in git-status,
> there are 7 that I can't figure out how to generate.

As the post [*1*] that triggered e92e9cd3 (Documentation
improvements for the description of short format., 2010-04-23),
which is where the bulk of the format description comes from, says,
this is "Patches welcome" ;-) Some are just covering possible
permutations and it is not surprising if they would not appear in
practice.

> D           M    deleted from index

I doubt this is possible in practice; once you do not have the entry
in the index, we do not even look at the working tree file, so it
would be unusual to see M in the second column.

> D           D    unmerged, both deleted
> A           U    unmerged, added by us
> U           A    unmerged, added by them

    $ x="100644 $(git hash-object --stdin </dev/null)" &&
      printf "$x 2\tbar\n$x 1\tfoo\n$x 3\tbaz" |
      git update-index --index-info
    $ git status --short -suno
    AU bar
    UA baz
    DD foo
    $ git ls-files -u
    100644 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 2       bar
    100644 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 3       baz
    100644 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 1       foo

When you are using higher-level machinery to merge, "we added, they
left it missing" (i.e. bar that has only stage #2) is automatically
resolved to an addition by the trivial merge machinery.  The "they
added, we left it missing" (i.e. baz with only stage #3) case is
identical.  Also "both of us removed" (i.e. foo that has only stage
#1) is resolved to a deletion by the trivial merge machinery.  Hence
you would not see these three unless you are developing Git using a
low-level plumbing machinery.

[Reference]

*1* http://thread.gmane.org/gmane.comp.version-control.git/144455/focus=144468

  reply	other threads:[~2014-04-01 21:38 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-01 20:07 git-status -- trying to understand all possible states Michael Toy
2014-04-01 21:37 ` Junio C Hamano [this message]
2014-04-01 23:01   ` Michael Toy
2014-04-01 22:20 ` Jonathan Nieder
2014-04-02  8:31   ` Matthieu Moy

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=xmqq4n2czq6n.fsf@gitster.dls.corp.google.com \
    --to=gitster@pobox$(echo .)com \
    --cc=git@vger$(echo .)kernel.org \
    --cc=michael@toyland$(echo .)org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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