All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paolo Bonzini <bonzini@gnu.org>
To: esr@thyrsus.com
Cc: Jakub Narebski <jnareb@gmail.com>,
	Jacob Helwig <jacob.helwig@gmail.com>,
	git@vger.kernel.org
Subject: Re: Status of all files
Date: Sun, 11 Apr 2010 00:12:33 +0200	[thread overview]
Message-ID: <4BC0F7D1.6000003@gnu.org> (raw)
In-Reply-To: <20100409140215.GB27899@thyrsus.com>

On 04/09/2010 04:02 PM, Eric Raymond wrote:
>>> >  >
>>> >  >     'needs-update      The file has not been edited by the user, but there is
>>> >  >                        a more recent version on the current branch stored
>>> >  >                        in the master file.
>> >
>> >  Needs*update*  looks like it came from centralized VCS like CVS and
>> >  Subversion, where you use update-the-commit method.  You can't say
>> >  that HEAD version is more recent that working file...
>> >
>> >  The rought equivalent would be that upstream branch for current
>> >  branch (e.g. 'origin/master' can be upstream for 'master' branch) is
>> >  in fast-forward state i.e. current branch is direct ancestor of
>> >  corresponding upstream branch, and the file was modified upstream.
>
> Agreed. But there's no way to tell that this is the case without
> doing a pull operation or otherwise querying origin, and I'm
> not going to do that.

You can query the origin _as it was on the last fetch_.

If you are on branch X, the logic is as follows:

- Let R be the value of configuration key branch.X.remote,
- let M be the value of configuration key branch.X.merge,
- for all values S of configuration key remote.R.fetch,
   - strip an initial +
   - if S is M:N, return N
   - if S is P/*:Q/* where P is a prefix of M, take M, replace this
     prefix with Q and return the result

In the most common case you will have:

- X = master
- R = origin
- M = refs/heads/master
- one key S = +refs/heads/*:refs/remotes/origin/*

so the prefix "refs/heads/" is replaced with "refs/remotes/origin/" and 
the result is refs/remotes/origin/master.

Paolo

  parent reply	other threads:[~2010-04-10 22:12 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-09  4:04 How can I tell if a file is ignored by git? Eric Raymond
2010-04-09  4:10 ` Jacob Helwig
2010-04-09 11:32   ` Status of all files (was: " Eric Raymond
2010-04-09 12:11     ` Randal L. Schwartz
2010-04-09 13:20       ` Eric Raymond
2010-04-10 19:07       ` Junio C Hamano
2010-04-09 12:56     ` Jakub Narebski
2010-04-09 14:02       ` Eric Raymond
2010-04-09 14:23         ` Matthieu Moy
2010-04-09 16:24           ` Eric Raymond
     [not found]             ` <z2h62a3a9cb1004091615q52bd5f5aqc24079de7f0038ba@mail.gmail.com>
2010-04-09 23:18               ` Daniel Grace
2010-04-10  3:35               ` Eric Raymond
2010-04-09 16:52           ` Junio C Hamano
2010-04-09 14:50         ` Jakub Narebski
2010-04-10 22:12         ` Paolo Bonzini [this message]
2010-04-11 10:25           ` Status of all files Jeff King
2010-04-09  4:50 ` How can I tell if a file is ignored by git? Ramkumar Ramachandra
2010-04-09  5:01   ` Ævar Arnfjörð Bjarmason
2010-04-09 10:50     ` Eric Raymond

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=4BC0F7D1.6000003@gnu.org \
    --to=bonzini@gnu.org \
    --cc=esr@thyrsus.com \
    --cc=git@vger.kernel.org \
    --cc=jacob.helwig@gmail.com \
    --cc=jnareb@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.