git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Josef Weidendorfer <Josef.Weidendorfer@gmx.de>
To: Junio C Hamano <junkio@cox.net>
Cc: git@vger.kernel.org
Subject: [PATCH] Add branch.*.merge warning and documentation update
Date: Sat, 9 Dec 2006 02:28:26 +0100	[thread overview]
Message-ID: <200612090228.26722.Josef.Weidendorfer@gmx.de> (raw)
In-Reply-To: <7vu006ez1i.fsf@assigned-by-dhcp.cox.net>

This patch clarifies the meaning of the branch.*.merge option.
Previously, if branch.*.merge was specified but did not match any
ref, the message "No changes." was not really helpful regarding
the misconfiguration. This patch adds a warning for this.

Signed-off-by: Josef Weidendorfer <Josef.Weidendorfer@gmx.de>
---

On Saturday 09 December 2006 00:41, Junio C Hamano wrote:
> Josef Weidendorfer <Josef.Weidendorfer@gmx.de> writes:
> 
> > But the previous documentation simply was way to short.
> 
> Yes, your documentation updates seems to make it much clearer.
> 
> > Should I send a "simplified" patch?
> 
> Thanks, appreciated.

Done.

Josef

 Documentation/config.txt |   11 +++++++++--
 git-parse-remote.sh      |   11 +++++++++++
 2 files changed, 20 insertions(+), 2 deletions(-)

diff --git a/Documentation/config.txt b/Documentation/config.txt
index 9090762..21ec557 100644
--- a/Documentation/config.txt
+++ b/Documentation/config.txt
@@ -125,10 +125,17 @@ apply.whitespace::
 
 branch.<name>.remote::
 	When in branch <name>, it tells `git fetch` which remote to fetch.
+	If this option is not given, `git fetch` defaults to remote "origin".
 
 branch.<name>.merge::
-	When in branch <name>, it tells `git fetch` the default remote branch
-	to be merged.
+	When in branch <name>, it tells `git fetch` the default refspec to
+	be marked for merging in FETCH_HEAD. The value has exactly to match
+	a remote part of one of the refspecs which are fetched from the remote
+	given by "branch.<name>.remote".
+	The merge information is used by `git pull` (which at first calls
+	`git fetch`) to lookup the default branch for merging. Without
+	this option, `git pull` defaults to merge the first refspec fetched.
+	Specify multiple values to get an octopus merge.
 
 pager.color::
 	A boolean to enable/disable colored output when the pager is in
diff --git a/git-parse-remote.sh b/git-parse-remote.sh
index da064a5..d72f061 100755
--- a/git-parse-remote.sh
+++ b/git-parse-remote.sh
@@ -134,6 +134,8 @@ canon_refs_list_for_fetch () {
 	# or the first one otherwise; add prefix . to the rest
 	# to prevent the secondary branches to be merged by default.
 	merge_branches=
+	found_mergeref=
+	curr_branch=
 	if test "$1" = "-d"
 	then
 		shift ; remote="$1" ; shift
@@ -171,6 +173,10 @@ canon_refs_list_for_fetch () {
 			    dot_prefix= && break
 			done
 		fi
+		if test -z $dot_prefix
+		then
+			found_mergeref=true
+		fi
 		case "$remote" in
 		'') remote=HEAD ;;
 		refs/heads/* | refs/tags/* | refs/remotes/*) ;;
@@ -191,6 +197,11 @@ canon_refs_list_for_fetch () {
 		fi
 		echo "${dot_prefix}${force}${remote}:${local}"
 	done
+	if test -z "$found_mergeref" -a "$curr_branch"
+	then
+		echo >&2 "Warning: No merge candidate found because value of config option
+         \"branch.${curr_branch}.merge\" does not match any remote branch fetched."
+	fi
 }
 
 # Returns list of src: (no store), or src:dst (store)
-- 
1.4.4.2.g1d08-dirty

  reply	other threads:[~2006-12-09  1:28 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-12-06  4:51 git pull and merging Aneesh Kumar
2006-12-06  5:02 ` Junio C Hamano
2006-12-06  5:21   ` Aneesh Kumar
2006-12-06  9:26     ` Johannes Schindelin
2006-12-06 10:00       ` Peter Baumann
2006-12-06 10:14         ` Johannes Schindelin
2006-12-06 10:23           ` Peter Baumann
2006-12-06 10:05       ` Aneesh Kumar
2006-12-06 10:28         ` Jakub Narebski
     [not found]           ` <cc723f590612060236k7839942el8d048eedfdee3682@mail.gmail.com>
     [not found]             ` <cc723f590612060248y6f730a54l3a2aadfa6500d36d@mail.gmail.com>
2006-12-06 10:48               ` Fwd: " Aneesh Kumar
2006-12-06 16:44         ` Josef Weidendorfer
2006-12-07  6:46           ` Aneesh Kumar K.V
2006-12-07 11:27             ` Josef Weidendorfer
2006-12-07 19:06               ` Junio C Hamano
2006-12-07 22:54                 ` Josef Weidendorfer
2006-12-08  1:56                   ` Santi Béjar
2006-12-08 17:23                     ` Josef Weidendorfer
2006-12-08 19:12                       ` [PATCH] Add branch.*.localmerge and documentation update Josef Weidendorfer
2006-12-08 20:52                         ` Santi Béjar
2006-12-08 21:38                           ` Junio C Hamano
2006-12-08 21:48                             ` Jakub Narebski
2006-12-08 22:01                             ` Josef Weidendorfer
2006-12-08 22:34                               ` Junio C Hamano
2006-12-08 23:17                                 ` Josef Weidendorfer
2006-12-08 23:41                                   ` Junio C Hamano
2006-12-09  1:28                                     ` Josef Weidendorfer [this message]
2006-12-09 16:14                                       ` [PATCH] Add branch.*.merge warning " Santi Béjar
2006-12-08 21:39                           ` [PATCH] Add branch.*.localmerge " Josef Weidendorfer
2006-12-08 22:15                             ` Santi Béjar
2006-12-08 20:09                       ` git pull and merging Santi Béjar
2006-12-08  7:07                   ` Junio C Hamano
2006-12-07 23:06                 ` Junio C Hamano
2006-12-08  2:04                   ` Santi Béjar
2006-12-08 11:48               ` Jakub Narebski
2006-12-06  9:31     ` Jakub Narebski
2006-12-06  9:58       ` Johannes Schindelin

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=200612090228.26722.Josef.Weidendorfer@gmx.de \
    --to=josef.weidendorfer@gmx.de \
    --cc=git@vger.kernel.org \
    --cc=junkio@cox.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).