{"thread":{"id":"43098","subject":"Unnecessary fetch warning","startedAt":"2006-12-18T08:16:31Z","lastAt":"2006-12-19T01:01:55Z","messageCount":2,"participants":["Shawn Pearce","Josef Weidendorfer"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"293841","messageId":"20061218081631.GA9727@spearce.org","threadId":"43098","inReplyTo":null,"subject":"Unnecessary fetch warning","fromName":"Shawn Pearce","fromEmail":"spearce@spearce.org","sentAt":"2006-12-18T08:16:31Z","receivedAt":"2006-12-18T08:16:31Z","isPatch":false,"sender":{"key":"spearce@spearce.org","avatar":"https://avatars.githubusercontent.com/u/34844?v=4"},"body":"Current 'next':\n\n  $ git fetch\n  Warning: No merge candidate found because value of config option\n           \"branch.sp/username-reflog.merge\" does not match any remote branch fetched.\n\nuhhh.. i asked for a fetch, not a merge.\n\nI have no branch.*.merge or branch.*.remote in my .git/config,\nand I only use the remote.*.url/remote.*.fetch format for my\nremote configs.\n\nCommit 62b339a5 added the warning, and its intended for pull, but\nit is tripping during fetch too.\n\nWhat about removing this warning from fetch, letting it mark\neverything as `not-for-merge` and let pull trigger the warning\ninstead?\n\n-- \n"},{"id":"294464","messageId":"200612190201.55300.Josef.Weidendorfer@gmx.de","threadId":"43098","inReplyTo":"20061218081631.GA9727@spearce.org","subject":"[PATCH] Move \"no merge candidate\" warning into git-pull","fromName":"Josef Weidendorfer","fromEmail":"josef.weidendorfer@gmx.de","sentAt":"2006-12-19T01:01:55Z","receivedAt":"2006-12-19T01:01:55Z","isPatch":true,"sender":{"key":"josef.weidendorfer@gmx.de","avatar":null},"body":"The warning triggered even when running \"git fetch\" only\nwhen resulting .git/FETCH_HEAD only contained\nbranches marked as 'not-for-merge'.\n\nSigned-off-by: Josef Weidendorfer <weidendo@gmx.de>\n---\n\n[Resent to mailing list; I forgot to add it]\n\nOn Monday 18 December 2006 09:16, Shawn Pearce <spearce@spearce.org> wrote:\n> Current 'next':\n> \n>   $ git fetch\n>   Warning: No merge candidate found because value of config option\n>            \"branch.sp/username-reflog.merge\" does not match any remote branch fetched.\n> \n> uhhh.. i asked for a fetch, not a merge.\n\nOops.\nI hope this does it right. Testing by the same person which does the patch\nis obviously almost the same as not testing at all.\n\nJosef\n\n git-parse-remote.sh |   10 ----------\n git-pull.sh         |    4 ++++\n 2 files changed, 4 insertions(+), 10 deletions(-)\n\ndiff --git a/git-parse-remote.sh b/git-parse-remote.sh\nindex 6ae534b..d02f404 100755\n--- a/git-parse-remote.sh\n+++ b/git-parse-remote.sh\n@@ -134,7 +134,6 @@ canon_refs_list_for_fetch () {\n \t# or the first one otherwise; add prefix . to the rest\n \t# to prevent the secondary branches to be merged by default.\n \tmerge_branches=\n-\tfound_mergeref=\n \tcurr_branch=\n \tif test \"$1\" = \"-d\"\n \tthen\n@@ -173,10 +172,6 @@ canon_refs_list_for_fetch () {\n \t\t\t    dot_prefix= && break\n \t\t\tdone\n \t\tfi\n-\t\tif test -z $dot_prefix\n-\t\tthen\n-\t\t\tfound_mergeref=true\n-\t\tfi\n \t\tcase \"$remote\" in\n \t\t'') remote=HEAD ;;\n \t\trefs/heads/* | refs/tags/* | refs/remotes/*) ;;\n@@ -197,11 +192,6 @@ canon_refs_list_for_fetch () {\n \t\tfi\n \t\techo \"${dot_prefix}${force}${remote}:${local}\"\n \tdone\n-\tif test -z \"$found_mergeref\" -a \"$curr_branch\"\n-\tthen\n-\t\techo >&2 \"Warning: No merge candidate found because value of config option\n-         \\\"branch.${curr_branch}.merge\\\" does not match any remote branch fetched.\"\n-\tfi\n }\n \n # Returns list of src: (no store), or src:dst (store)\ndiff --git a/git-pull.sh b/git-pull.sh\nindex e23beb6..1703091 100755\n--- a/git-pull.sh\n+++ b/git-pull.sh\n@@ -76,6 +76,10 @@ merge_head=$(sed -e '/\tnot-for-merge\t/d' \\\n \n case \"$merge_head\" in\n '')\n+\tcurr_branch=$(git-symbolic-ref HEAD | \\\n+\t\tsed -e 's|^refs/heads/||')\n+\techo >&2 \"Warning: No merge candidate found because value of config option\n+         \\\"branch.${curr_branch}.merge\\\" does not match any remote branch fetched.\"\n \techo >&2 \"No changes.\"\n \texit 0\n \t;;\n-- \n1.4.4.2.gee60-dirty\n"}]}