#554160 git-core: git-remote gets confused by overlapping fetch lines

Package:
git
Source:
git
Description:
fast, scalable, distributed revision control system
Submitter:
Frédéric Brière
Date:
2010-09-03 04:24:04 UTC
Severity:
normal
#554160#5
Date:
2009-11-03 13:26:28 UTC
From:
To:
TopGit inserts the following fetch lines in .git/config:

  fetch = +refs/heads/*:refs/remotes/origin/*
  fetch = +refs/top-bases/*:refs/remotes/origin/top-bases/*

This confuses git-remote show/prune, as top-bases/* now matches both
lines; each ref will be declared up-to-date according to one, and
obsolete according to the other.

Here's a simple illustration:

  mkdir 1
  cd 1
  git init
  touch foo
  git add foo
  git commit -m foo
  git update-ref refs/feet/slave HEAD
  cd ..
  git clone 1 2
  cd 2
  sed -ie '/fetch =/a\\tfetch = +refs/feet/*:refs/remotes/origin/feet/*' \
  	.git/config
  git remote show origin
  git remote update origin
  git remote prune origin
  git remote update origin

#554160#20
Date:
2010-09-03 04:20:15 UTC
From:
To:
forwarded 554160 http://thread.gmane.org/gmane.comp.version-control.git/154489/focus=154500
quit

Frédéric Brière wrote:

Yep.  "fetch --prune" even seems to cope poorly with nonoverlapping
refspecs.