Re: Branches and all commits

From: Andreas Ericsson <ae@op5.se>
Date: 2005-12-20 03:15:12
Jon Nelson wrote:
> Should *all* commits be reachable via at least one branch? I ran into a 
> situation this weekend that has me a little confused. I had performed a 
> number of commits and such and I noticed that the author and committer 
> info had suboptimal values. A bit of searching led me to a comment made 
> by Linus that basically said "go hack git-convert-objects", which I did. 
> After performing git-convert-objects on every commit object in 
> .git/refs/heads and the requisite pruning, etc... just about everything 
> looked fine. However, I still had a long series of commits that 
> contained the wrong information. Further inspection makes it appear as 
> though these commits are not reachable via any branch, although they are 
> /all/ reachable via a series of tags. I worked around the problem by 
> further modifying git-convert-objects to also understand tags (at least 
> the basic ones I've got) and that's all taken care of, but the question 
> remains: should *all* commit objects be reachable by at least one 
> branch?
> 

AFAIU, yes.

For future reference, what you should have done is this;

$ git format-patch --mbox <first-unscrewed-commit-ish>
# edit commit-messages in generated patches
$ git reset --hard <first-unscrewed-commit-ish>
$ for i in 00*.txt; do git apply < $i; done
$ git prune;# to get rid of the unreachable objects AFTER you've checked 
everything's all right

If things fail, do

$ git reset --hard ORIG_HEAD

and ask again.

I'm afraid I can't help you fix up your repository from the state it's 
in now. AFAIK, there's no tool to do it automagically.

-- 
Andreas Ericsson                   andreas.ericsson@op5.se
OP5 AB                             www.op5.se
Tel: +46 8-230225                  Fax: +46 8-230231
-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Received on Tue Dec 20 03:15:49 2005

This archive was generated by hypermail 2.1.8 : 2005-12-20 03:15:55 EST