git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <junkio@cox.net>
To: git@vger.kernel.org
Subject: [PATCH] Make "git pull" and "git fetch" default to origin
Date: Sat, 20 Aug 2005 11:25:30 -0700	[thread overview]
Message-ID: <7v64u0mpnp.fsf@assigned-by-dhcp.cox.net> (raw)
In-Reply-To: 7vvf20o4sp.fsf@assigned-by-dhcp.cox.net

Amos Waterland sent in a patch for the pre-multi-head aware
version of "git pull" to do this, but the code changed quite a
bit since then.  If there is no argument given to pull from, and
if "origin" makes sense, default to fetch/pull from "origin"
instead of barfing.

[jc: besides, the patch by Amos broke the non-default case where
explicit refspecs are specified, and did not make sure we know
what "origin" means before defaulting to it.]

Signed-off-by: Junio C Hamano <junkio@cox.net>

---

 git-fetch-script |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

6d8fcdbf772f4fc4ec7ae67630b52bc8a07d7b6d
diff --git a/git-fetch-script b/git-fetch-script
--- a/git-fetch-script
+++ b/git-fetch-script
@@ -8,7 +8,10 @@ _x40="$_x40$_x40$_x40$_x40$_x40$_x40$_x4
 append=
 case "$#" in
 0)
-	die "Where do you want to fetch from?" ;;
+	test -f "$GIT_DIR/branches/origin" ||
+		test -f "$GIT_DIR/remotes/origin" ||
+			die "Where do you want to fetch from?"
+	set origin ;;
 *)
 	case "$1" in
 	-a|--a|--ap|--app|--appe|--appen|--append)

  parent reply	other threads:[~2005-08-20 18:25 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-08-20 18:13 Updated multi-head downloads and $GIT_DIR/remotes/ support Junio C Hamano
2005-08-20 18:22 ` [PATCH] Start adding the " Junio C Hamano
2005-08-20 18:25 ` [PATCH] Multi-head fetch Junio C Hamano
2005-08-20 18:25 ` [PATCH] Retire git-parse-remote Junio C Hamano
2005-08-20 18:25 ` [PATCH] Infamous 'octopus merge' Junio C Hamano
2005-08-20 18:25 ` Junio C Hamano [this message]
2005-08-20 18:25 ` [PATCH] Use .git/remote/origin, not .git/branches/origin Junio C Hamano

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=7v64u0mpnp.fsf@assigned-by-dhcp.cox.net \
    --to=junkio@cox.net \
    --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).