git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* v2.15.0: commits become falsely joined when rebasing (interactively)
@ 2017-11-19  1:45 Steffen Nurpmeso
  0 siblings, 0 replies; only message in thread
From: Steffen Nurpmeso @ 2017-11-19  1:45 UTC (permalink / raw)
  To: git

Hello again,

i see an error with v2.15.0 that happened already back in early
October (AlpineLinux [edge] pretty much up-to-date with newest git
but please don't ask exact version).  I failed to reproduce it
back then, but now again, here is how.

- It seems related to having a hook (pre-commit), and the "reword"
  action.
- Doing a rebase interactively to move (two) commits back from
  HEAD downwards in a linear hierarchy, as in
    * 306b5c7e (HEAD -> refs/heads/notpushed) [-] COMMIT 1
    * 7e34d5fa [-] COMMIT 2
  the above two to be moved down
    * 65d216c3 (refs/remotes/origin/notpushed)...
    ...
    * 5ff5ef05 (refs/remotes/origin/next, refs/heads/next) [-]..
  to end up stacked upon and as new [next]

- COMMIT 2 is to be picked, but COMMIT 1 shall be "r"eworded.

Now what happens is that COMMIT 2 is rebased ok, but instead of
simply opening the editor to allow rewording of the commit message
of COMMIT 2 the pre-commit hook runs, and it has to complain in
this case (lines too long), but i "commit -n" that once
i committed first.  Anyway git says

  You can amend the commit now, with

    git commit --amend

  Once you are satisfied with your changes, run

    git rebase --continue

Which i have not asked for!  More:

  ?1[steffen@essex nail.git]$ git status
  interactive rebase in progress; onto 6d437ab6
  Last commands done (12 commands done):
     pick 7e34d5fa [-] COMMIT 2
     r 306b5c7e [-] COMMIT 1
    (see more in file .git/rebase-merge/done)
  Next commands to do (27 remaining commands):
  ...
    (use "git rebase --edit-todo" to view and edit)
  You are currently rebasing branch 'notpushed' on '6d437ab6'.
    (all conflicts fixed: run "git rebase --continue")

  Changes to be committed:
    (use "git reset HEAD <file>..." to unstage)

          modified:   gen-okeys.h

  Untracked files not listed (use -u option to show untracked files)

So far so good, but now:

  ?0[steffen@essex nail.git]$ git rec
alias: rebase --continue
  [detached HEAD ca77a94a] COMMIT 1 with adjusted commit message
   Date: Sun Nov 19 02:19:30 2017 +0100
   9 files changed, 357 insertions(+), 339 deletions(-)
  Successfully rebased and updated refs/heads/notpushed.

Uh!  It joined COMMIT 1 with COMMIT 2!
Thanks for git!

Ciao,

--steffen
|
|Der Kragenbaer,                The moon bear,
|der holt sich munter           he cheerfully and one by one
|einen nach dem anderen runter  wa.ks himself off
|(By Robert Gernhardt)

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2017-11-19  1:53 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-19  1:45 v2.15.0: commits become falsely joined when rebasing (interactively) Steffen Nurpmeso

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).