git: When updating from remote, use git pull --prune, to avoid possible errors from...
authorJoey Hess <joey@kitenet.net>
Tue, 14 Sep 2010 19:45:38 +0000 (15:45 -0400)
committerJoey Hess <joey@kitenet.net>
Tue, 14 Sep 2010 19:45:38 +0000 (15:45 -0400)
IkiWiki/Plugin/git.pm
debian/changelog
doc/bugs/git.pm_should_prune_remote_branches_when_fetching.mdwn

index d342a7398bd2ce4458241ccb68a5ad6879edd70e..fd57ce1e466de034e457a365a13f8960d04957f3 100644 (file)
@@ -462,7 +462,7 @@ sub rcs_update () {
        # Update working directory.
 
        if (length $config{gitorigin_branch}) {
-               run_or_cry('git', 'pull', $config{gitorigin_branch});
+               run_or_cry('git', 'pull', '--prune', $config{gitorigin_branch});
        }
 }
 
index 46401b58cbb8b51d4cd3a860af0a982e76b89eb3..27e0fb1033f8f75345891695ced03d35f8c12cb1 100644 (file)
@@ -22,6 +22,8 @@ ikiwiki (3.20100832) UNRELEASED; urgency=low
   * external: Disable RPC::XML's "smart" encoding, which sent ints
     for strings that contained only a number, fixing a longstanding crash
     of the rst plugin.
+  * git: When updating from remote, use git pull --prune, to avoid possible
+    errors from conflicting obsolete remote branches.
 
  -- Joey Hess <joeyh@debian.org>  Tue, 07 Sep 2010 12:08:05 -0400
 
index 01f3d1a2861976b0b78a1ca8e8854149fc09b39d..5dc4250e38aff02baaab5256d4d6c9aa3c21b343 100644 (file)
@@ -9,3 +9,6 @@ Pruning remote branches can be done automatically with the --prune option to "gi
 > from obsolete remote branches. --[[Joey]] 
 
 Suppose a remote repository contains a branch named "foo", and you fetch from it.  Then, someone renames that branch to "foo/bar".  The next time you fetch from that repository, you will get an error because the obsolete branch "foo" is blocking the branch "foo/bar" from being created (due to the way git stores refs for branches).  Pruning gets around the problem.  It doesn't really add much overhead to the fetch, and in fact it can *save* overhead since obsolete branches do consume resources (any commits they point to cannot be garbage collected).  --[[blipvert]]
+
+> Ok, so git pull --prune can be used to do everything in one command.
+> [[done]] --[[Joey]]