git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: git rebase orthodontics

From
Thomas Rast <trast@student.ethz.ch>
Date
Jan 7, 2009, 16:31 UTC
Message-ID
<200901071731.20343.trast@student.ethz.ch>
In-Reply-To
<87sknvxje8.fsf@jidanni.org>
jidanni@jidanni.org wrote:
> wherein he discovers there are no guard rails
Good thing you learned this before getting to git-reset.
Show 12 quoted lines
> $ EDITOR=cat git rebase --interactive master
> pick 07aef4a This is a commit with No files, wow. bla.
> # Rebase 3ad166e..07aef4a onto 3ad166e ...
> Successfully rebased and updated refs/heads/jidanni.
> (But it didn't. git show shows no change. ls -l shows
> refs/heads/jidanni was not touched.
> OK, it seems like all I am doing is changing
>               A jidanni
>              /
> D---E---F---G master
> into the same thing, a noop. But shouldn't it warn and quit, instead
> of rewarding me with the success message?

You asked for an interactive rebase of the range master..jidanni, which consists of A, so it gave you an editor offering 'pick A' and the chance to change that.

Non-interactive rebase indeed checks if you attempt to rebase, but are already up to date. Interactive doesn't; the assumption is that interactive rebases aren't used "blindly" to update. (Rebasing changes committer and commit time, so there is a difference between not rebasing at all, and merely ending up with the same history.)

Show 12 quoted lines
> Let's try it the other way
> around:
> $ git checkout master
> $ git rebase --interactive jidanni #Wherein one sees:
> noop
> # Rebase 07aef4a..3ad166e onto 07aef4a
> Successfully rebased and updated refs/heads/master.
> OK, now I have achieved
> D---E---F---G---A master, jidanni
> Observations:
> When I tried a noop, it didn't say noop in the editor.
> When I tried a yesop, it did say noop in the editor.

The 'noop' means that there are no commits in the range you asked to rebase, which is jidanni..master. It's telling you that it is going to update the branch pointer, but not carry over any of the commits. This can happen even if jidanni..master is nonempty, but all commits in it are already contained in jidanni.

> In both cases it gave the same success message.
It successfully did what you told it to do.
-- 
Thomas Rast
trast@{inf,student}.ethz.ch
Previous: Boyd Stephen Smith Jr.
Message 3 of 3 in “git rebase orthodontics”
  1. jidanni@jidanni.orgJan 7, 2009
  2. Boyd Stephen Smith Jr.Jan 7, 2009
  3. Thomas RastJan 7, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.