git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Damien Robert <damien.olivier.robert@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: Pull without fetch
Date: Mon, 08 Apr 2019 10:34:07 +0900	[thread overview]
Message-ID: <xmqq4l79cmb4.fsf@gitster-ct.c.googlers.com> (raw)
In-Reply-To: <20190406131200.xcd7gtf7dlc567uh@doriath> (Damien Robert's message of "Sat, 6 Apr 2019 15:12:00 +0200")

Damien Robert <damien.olivier.robert@gmail.com> writes:

> is there a way to do a git pull without it running git fetch?
> Looking at the source in builtin/pull.c does not seem to indicate so.

The reason behind that is because it does not make any sense for
"pull", which is meant as a quick short-cut to say "fetch && merge",
not to run fetch, especially back then when 'git pull' was designed,
the world was much simpler.  There was no "fetch && rebase", our
branches did not know what their @{upstream}s were.  In that simpler
world, what you are trying to do would have been:

	git fetch
	# did I get anything worth integrating?
	git merge FETCH_HEAD

That obviously would not work for those with "pull.rebase", and I do
not think it makes much sense to teach "git rebase" the same trick
to read FETCH_HEAD as "git merge" does in the above sequence.

Others may have a better idea, but I do not immediately see any
solution better than inventing a new option to "git pull".

Another and better option that may be harder to arrange is to make
sure that a no-op "git fetch" incurs very low cost.  If you did so,
"git fetch && git pull" would perform just like your "git fetch &&
git pull --no-fetch", and we won't need a new option at all.

  reply	other threads:[~2019-04-08  1:34 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-06 13:12 Pull without fetch Damien Robert
2019-04-08  1:34 ` Junio C Hamano [this message]
2019-04-08  2:17   ` Duy Nguyen
2019-04-08 12:51     ` Ævar Arnfjörð Bjarmason
2019-04-08 13:18       ` Duy Nguyen
2019-04-08 14:53   ` Damien Robert
2019-04-08 16:11     ` Damien Robert
2019-04-09  8:03       ` Junio C Hamano
2019-04-11 11:07         ` Damien Robert

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=xmqq4l79cmb4.fsf@gitster-ct.c.googlers.com \
    --to=gitster@pobox.com \
    --cc=damien.olivier.robert@gmail.com \
    --cc=git@vger.kernel.org \
    /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).