All of lore.kernel.org
 help / color / mirror / Atom feed
* git rebase -i does not rebase if all lines are removed
@ 2012-07-17 10:46 Orgad and Raizel Shaneh
  2012-07-17 10:55 ` Carlos Martín Nieto
  0 siblings, 1 reply; 3+ messages in thread
From: Orgad and Raizel Shaneh @ 2012-07-17 10:46 UTC (permalink / raw)
  To: git

Make a commit on top of master.

git rebase -i origin/master

Remove the commit.

Git prints "Nothing to do" and does not rebase.

Running 'git rebase -i' when there are no local commits has 'noop' in
the first line, and with it the rebase is successful. Why is this
'noop' mandatory?

- Orgad

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: git rebase -i does not rebase if all lines are removed
  2012-07-17 10:46 git rebase -i does not rebase if all lines are removed Orgad and Raizel Shaneh
@ 2012-07-17 10:55 ` Carlos Martín Nieto
  2012-07-17 12:25   ` Johannes Sixt
  0 siblings, 1 reply; 3+ messages in thread
From: Carlos Martín Nieto @ 2012-07-17 10:55 UTC (permalink / raw)
  To: Orgad and Raizel Shaneh; +Cc: git

On Tue, 2012-07-17 at 13:46 +0300, Orgad and Raizel Shaneh wrote:
> Make a commit on top of master.
> 
> git rebase -i origin/master
> 
> Remove the commit.
> 
> Git prints "Nothing to do" and does not rebase.
> 
> Running 'git rebase -i' when there are no local commits has 'noop' in
> the first line, and with it the rebase is successful. Why is this
> 'noop' mandatory?

If you read the instructions, the last line says

    # However, if you remove everything, the rebase will be aborted

so if you want to do a no-op, then you need to tell it. This is the same
way you abort a commit, by providing it with an empty message.

But more important would be /why/ you feel that rebase -i is the tool
you should be using. If you'd like to move the branch pointer back,
that's what the reset command is for. rebase deals with moving commits
from one base to another and optionally reordering, squashing or
removing some of them.

   cmn

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: git rebase -i does not rebase if all lines are removed
  2012-07-17 10:55 ` Carlos Martín Nieto
@ 2012-07-17 12:25   ` Johannes Sixt
  0 siblings, 0 replies; 3+ messages in thread
From: Johannes Sixt @ 2012-07-17 12:25 UTC (permalink / raw)
  To: Carlos Martín Nieto; +Cc: Orgad and Raizel Shaneh, git

Am 7/17/2012 12:55, schrieb Carlos Martín Nieto:
> But more important would be /why/ you feel that rebase -i is the tool
> you should be using. If you'd like to move the branch pointer back,
> that's what the reset command is for.

Perhaps because that's not what the OP wanted to do?

Sometimes it happens that you rebase a bunch of commits, and only a
handful remains because the others are already in upstream. Looking at
each remaining one closely, you decide that they don't have to be rebased
(maybe because slightly modified versions are in upstream), so you remove
them one by one, and you end up with an empty list.

This has happened to me at one point, and writing "noop" after the list is
empty is a minor nuisance. But I am not complaining. Because being able to
abort an interactive rebase by clearing the list is much more important.

-- Hannes

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-07-17 12:25 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-07-17 10:46 git rebase -i does not rebase if all lines are removed Orgad and Raizel Shaneh
2012-07-17 10:55 ` Carlos Martín Nieto
2012-07-17 12:25   ` Johannes Sixt

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.