git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tay Ray Chuan <rctay89@gmail.com>
To: SLONIK.AZ@gmail.com
Cc: Nicolas Pitre <nico@fluxnic.net>,
	Junio C Hamano <gitster@pobox.com>,
	Git Mailing List <git@vger.kernel.org>
Subject: Re: How to check new commit availability without full fetch?
Date: Mon, 11 Jan 2010 09:57:51 +0800	[thread overview]
Message-ID: <be6fef0d1001101757w7f54c9b2ye58c66179137efb1@mail.gmail.com> (raw)
In-Reply-To: <ee2a733e1001101736p2f395de6ka05044fe7cca624d@mail.gmail.com>

Hi,

On Mon, Jan 11, 2010 at 9:36 AM, Leo Razoumov <slonik.az@gmail.com> wrote:
> On 2010-01-10, Nicolas Pitre <nico@fluxnic.net> wrote:
>> On Sun, 10 Jan 2010, Junio C Hamano wrote:
>>  >
>>  > A feel good factor is in play?  IOW, "I am short of time, so I won't be
>>  > able to really afford to 'git pull' and test the result of re-integrating
>>  > my changes to what happened on the other end.  If I can learn that there
>>  > is nothing happening over there, then I won't have to do anything and know
>>  > that I am up to date."
>>
>>
>> Just do a fetch then.  If the fetch progress display looks like if it is
>>  going to take a while then just interrupt it and go home.  If the fetch
>>  looks trivial then just merge it.  In any case, the "feel good" factor
>>  can't be that great by only knowing if the remote has changed or not.
>>
>
> Forced interruption is not such a good idea. I would favor a
> non-destructive way to monitor availability of remote commits.

By default, when you add a remote (with git remote add), git sets up
the fetch refspec in your config that looks like

  [remote "foo"]
    url = git://foo.com/git/foo.git
    fetch = refs/heads/*:refs/remotes/foo/*

That is to say, branches on the remote repo will be fetched into a
"safe" area, refs/remotes/foo/, away from the branches that you
normally work with in refs/heads/.

However, if you have a different config and you're fetching directly
into refs/heads/, then I can see why you would want to "peek" first
with --dry-run before fetching. Are you doing this?

> BTW, pull and push are in a way symmetric operations. Is there any
> deep reason why push supports --dry-run but pull/fetch does not??

It's more accurate to say that push and fetch are symmetric, because
pull is fetch with merge or rebase tacked on.

Even then, push and fetch are not _that_ symmetric...

-- 
Cheers,
Ray Chuan

  reply	other threads:[~2010-01-11  1:57 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-01-10 11:12 How to check new commit availability without full fetch? Leo Razoumov
2010-01-10 20:13 ` Nicolas Pitre
2010-01-10 20:38   ` Junio C Hamano
2010-01-10 21:05     ` Nicolas Pitre
2010-01-11  1:36       ` Leo Razoumov
2010-01-11  1:57         ` Tay Ray Chuan [this message]
2010-01-11  2:08           ` Junio C Hamano
2010-01-11  5:29             ` Michael Witten
2010-01-11  7:12               ` Junio C Hamano
2010-01-11  2:01         ` Nicolas Pitre
2010-01-11 16:22           ` Leo Razoumov
2010-01-11 17:04             ` Nicolas Pitre
2010-01-11 17:35               ` Leo Razoumov
2010-01-11  5:38         ` Dmitry Potapov
2010-01-11  7:31 ` Robin Rosenberg
2010-01-11  8:09   ` Junio C Hamano
2010-01-11 17:59     ` Nicolas Pitre
2010-01-11 19:20       ` Junio C Hamano
2010-01-11 20:52         ` Nicolas Pitre
2010-01-11 20:06 ` Andreas Schwab

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=be6fef0d1001101757w7f54c9b2ye58c66179137efb1@mail.gmail.com \
    --to=rctay89@gmail.com \
    --cc=SLONIK.AZ@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=nico@fluxnic.net \
    /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).