All of lore.kernel.org
 help / color / mirror / Atom feed
* Unnecessary fetch warning
@ 2006-12-18  8:16 Shawn Pearce
  2006-12-19  1:01 ` [PATCH] Move "no merge candidate" warning into git-pull Josef Weidendorfer
  0 siblings, 1 reply; 2+ messages in thread
From: Shawn Pearce @ 2006-12-18  8:16 UTC (permalink / raw)
  To: git

Current 'next':

  $ git fetch
  Warning: No merge candidate found because value of config option
           "branch.sp/username-reflog.merge" does not match any remote branch fetched.

uhhh.. i asked for a fetch, not a merge.

I have no branch.*.merge or branch.*.remote in my .git/config,
and I only use the remote.*.url/remote.*.fetch format for my
remote configs.

Commit 62b339a5 added the warning, and its intended for pull, but
it is tripping during fetch too.

What about removing this warning from fetch, letting it mark
everything as `not-for-merge` and let pull trigger the warning
instead?

-- 

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [PATCH] Move "no merge candidate" warning into git-pull
  2006-12-18  8:16 Unnecessary fetch warning Shawn Pearce
@ 2006-12-19  1:01 ` Josef Weidendorfer
  0 siblings, 0 replies; 2+ messages in thread
From: Josef Weidendorfer @ 2006-12-19  1:01 UTC (permalink / raw)
  To: git

The warning triggered even when running "git fetch" only
when resulting .git/FETCH_HEAD only contained
branches marked as 'not-for-merge'.

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

[Resent to mailing list; I forgot to add it]

On Monday 18 December 2006 09:16, Shawn Pearce <spearce@spearce.org> wrote:
> Current 'next':
> 
>   $ git fetch
>   Warning: No merge candidate found because value of config option
>            "branch.sp/username-reflog.merge" does not match any remote branch fetched.
> 
> uhhh.. i asked for a fetch, not a merge.

Oops.
I hope this does it right. Testing by the same person which does the patch
is obviously almost the same as not testing at all.

Josef

 git-parse-remote.sh |   10 ----------
 git-pull.sh         |    4 ++++
 2 files changed, 4 insertions(+), 10 deletions(-)

diff --git a/git-parse-remote.sh b/git-parse-remote.sh
index 6ae534b..d02f404 100755
--- a/git-parse-remote.sh
+++ b/git-parse-remote.sh
@@ -134,7 +134,6 @@ 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
@@ -173,10 +172,6 @@ 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/*) ;;
@@ -197,11 +192,6 @@ 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)
diff --git a/git-pull.sh b/git-pull.sh
index e23beb6..1703091 100755
--- a/git-pull.sh
+++ b/git-pull.sh
@@ -76,6 +76,10 @@ merge_head=$(sed -e '/	not-for-merge	/d' \
 
 case "$merge_head" in
 '')
+	curr_branch=$(git-symbolic-ref HEAD | \
+		sed -e 's|^refs/heads/||')
+	echo >&2 "Warning: No merge candidate found because value of config option
+         \"branch.${curr_branch}.merge\" does not match any remote branch fetched."
 	echo >&2 "No changes."
 	exit 0
 	;;
-- 
1.4.4.2.gee60-dirty

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2006-12-19  1:02 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-12-18  8:16 Unnecessary fetch warning Shawn Pearce
2006-12-19  1:01 ` [PATCH] Move "no merge candidate" warning into git-pull Josef Weidendorfer

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.