Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Renaming a commit as part of stg refresh -e ignores changes to the body #470

Closed
Byron opened this issue Jul 14, 2024 · 1 comment
Closed

Comments

@Byron
Copy link
Contributor

Byron commented Jul 14, 2024

How to reproduce

  • create a commit with stg new current, with a message body that says 'old'
  • use stg refresh -e to edit the commit message to new, but also change the first line to alter current to renamed

You will see that stg series -Id will show that the commit was renamed to renamed, but the commit message will still be old.

Expected behaviour

stg refresh -e is there to change the message of a commit, so it was surprising to see it would throw that away rather than the rename of the commit. Ideally, it would keep all the changes the user made, or error gracefully without discarding data.

Environment

❯ stg --version
Stacked Git 2.4.1
Copyright (C) 2005-2022 StGit authors
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
SPDX-License-Identifier: GPL-2.0-only
git version 2.39.3 (Apple Git-146)
@jpgrayson
Copy link
Collaborator

Thanks for this issue report @Byron.

I was able to reproduce the problem with stg refresh -e.

An interesting clue (and workaround) is that the same issue does not occur with plain stg edit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants