All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andreas Ericsson <ae@op5.se>
To: Jon Nelson <jnelson-git@jamponi.net>
Cc: git@vger.kernel.org
Subject: Re: Branches and all commits
Date: Mon, 19 Dec 2005 17:15:12 +0100	[thread overview]
Message-ID: <43A6DC90.3040403@op5.se> (raw)
In-Reply-To: <Pine.LNX.4.63.0512190908140.6812@gheavc.wnzcbav.cig>

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

  reply	other threads:[~2005-12-19 16:15 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-12-19 15:15 Branches and all commits Jon Nelson
2005-12-19 16:15 ` Andreas Ericsson [this message]
2005-12-19 17:39   ` Jon Nelson
2005-12-19 17:52     ` Andreas Ericsson
2005-12-19 18:59       ` Jon Nelson
2005-12-19 19:32         ` Andreas Ericsson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=43A6DC90.3040403@op5.se \
    --to=ae@op5.se \
    --cc=git@vger.kernel.org \
    --cc=jnelson-git@jamponi.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.