Git development
 help / color / mirror / Atom feed
From: Eric Raible <raible@gmail.com>
To: git@vger.kernel.org
Subject: RFC: git rebase -i and root commits
Date: Wed, 23 Jul 2008 01:58:41 +0000 (UTC)	[thread overview]
Message-ID: <loom.20080723T013019-412@post.gmane.org> (raw)

My normal workflow is to create a .gitignore in my initial commit.

When I later realize that I've forgotten something from that file
I could of course just commit the changes, but I'd rather use "git rebase -i"
in the normal way to make myself appear smarter than I am.
Especially since this realization usually comes early on
(and certainly before publishing).

But rebase can't go all the way to a root ("fatal: Needed a single revision").
The best I've found is:

1) git checkout -b temp <root commit>
2) echo '*.tmp' >> .gitignore
3) git commit --amend .gitignore
4) git rebase --onto temp <root commit> master

If there really is an asymmetry here and I haven't missed anything
(a large assumption), then what's the best way to think about it?

Is there a role for a default commit (e.g. the sha1 of "") here so that
'rebase -i' can update all commits and not just the ones with parents?

Or should I just get used to it and move on?

Thanks - Eric

             reply	other threads:[~2008-07-23  1:59 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-07-23  1:58 Eric Raible [this message]
2008-07-23  2:02 ` RFC: git rebase -i and root commits Stephan Beyer
2008-07-23  9:05   ` Johannes Schindelin

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=loom.20080723T013019-412@post.gmane.org \
    --to=raible@gmail.com \
    --cc=git@vger.kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox