This patch deprecates the behavior of "git pull" without a
branch.<name>.remote value in the configuration. The value
"origin" will be used, but a warning will be printed too.
Signed-off-by: Paolo Bonzini <bonzini@gnu.org>
---
Documentation/git-pull.txt | 9 +++++----
git-parse-remote.sh | 8 ++++++++
2 files changed, 13 insertions(+), 4 deletions(-)
In this case, I think we can warn because branch.*.remote
lines are created by checkouts made with 1.5 or later.
diff --git a/Documentation/git-pull.txt b/Documentation/git-pull.txt
index 3405ca0..18898f6 100644
--- a/Documentation/git-pull.txt
+++ b/Documentation/git-pull.txt
@@ -58,10 +58,11 @@ DEFAULT BEHAVIOUR
-----------------
Often people use `git pull` without giving any parameter.
-Traditionally, this has been equivalent to saying `git pull
-origin`. However, when configuration `branch.<name>.remote` is
-present while on branch `<name>`, that value is used instead of
-`origin`.
+While on branch `<name>`, this will use the value of configuration
+`branch.<name>.remote` as the branch to pull from. If the
+value is not present, it will be implicitly considered to be
+`origin`; however, this is deprecated and you consider
+writing the value explicitly in the configuration file.
In order to determine what URL to use to fetch from, the value
of the configuration `remote.<origin>.url` is consulted
diff --git a/git-parse-remote.sh b/git-parse-remote.sh
index 695a409..eddb593 100755
--- a/git-parse-remote.sh
+++ b/git-parse-remote.sh
@@ -54,9 +54,17 @@ get_remote_url () {
esac
}
+warned_about_default_remote=no
get_default_remote () {
curr_branch=$(git symbolic-ref -q HEAD | sed -e 's|^refs/heads/||')
origin=$(git config --get "branch.$curr_branch.remote")
+ if test -z "$origin" && test "$warned_about_default_remote" = no; then
+ echo "warning: you asked me to pull without telling me which repository"
+ echo "warning: you want to pull from, and 'branch.${curr_branch}.remote'"
+ echo "warning: in your configuration file does not tell me either."
+ echo "warning: proceeding with 'origin'."
+ warned_about_default_remote=yes
+ fi
echo ${origin:-origin}
}
--
1.5.5
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
| david | Re: Dual-Licensing Linux Kernel with GPL V2 and GPL V3 |
| Natalie Protasevich | [BUG] New Kernel Bugs |
| Brice Goglin | Re: Linux 2.6.21-rc2 |
| Christian Volkmann | 2.6.23-rc6: usb 1-1: device not accepting address 2, error -62 |
git: | |
| Jon Smirl | Re: VCS comparison table |
| Nicolas Pitre | Re: git to libgit2 code relicensing |
| Giuseppe Bilotta | [PATCHv3 0/4] gitweb: remote heads feature |
| Mark Burton | Git commit won't add an untracked file given on the command line |
| Nick Guenther | Re: Real men don't attack straw men |
| Tanvir | Re: Adobe Flash on OpenBSD |
| Marius ROMAN | 1440x900 resolution problem |
| Gilles Chehade | Re: wpi (4) and 4.4 |
| Johann Baudy | Re: [PATCH] Packet socket: mmapped IO: PACKET_TX_RING |
| Volker Armin Hemmann | build error with 2.6.27.6+reiser4+ehci-hub patch. ERROR: "mii_ethtool_gset" [drive... |
| Patrick Ohly | [RFC PATCH 00/13] hardware time stamping + igb example implementation |
| Laszlo Attila Toth | [PATCHv7 3/5] Interface group: core (netlink) part |
