Skip to content

git stack amend -e eats commit message #307

Open
@Kinrany

Description

@Kinrany

Please complete the following tasks

  • I have searched the discussions
  • I have searched the existing issues

Description

git stack amend -e fails to apply staged changes and to edit the commit message at the same time if the current branch has another branch stacked on top.

git-stack allows the user to write the message but then errors out with cannot reword; first squash dependent fixups. The staged changes get added as a new fixup! commit. The message is lost.

Version

git-stack 0.10.15

Steps to reproduce

  1. Create two commits, commit0 and commit1. commit1 is on top of commit0.
  2. Create two branches, branch0 on commit0 and branch1 on commit1.
  3. Switch to branch0.
  4. Make a change to the working tree and stage it.
  5. Run git stack amend -e.
  6. Write and save the commit message.

Actual Behaviour

Error happens after I've already typed the commit message. The message is irrecoverably lost. The staged changes end up in a new fixup! commit on top of branch0.

Expected Behaviour

git-stack performs the amend operation and changes the commit message.

Alternatively, git-stack warns that the operation cannot be performed before the user starts editing the commit message.

Alternatively, git-stack dumps the whole message into the console or into a temporary file.

Debug Output

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugNot as expected

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions