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

git reword on a public commit loses the message edits, wrong hint in error message #515

Closed
ilyagr opened this issue Aug 28, 2022 · 3 comments · Fixed by #530
Closed

git reword on a public commit loses the message edits, wrong hint in error message #515

ilyagr opened this issue Aug 28, 2022 · 3 comments · Fixed by #530
Labels
bug Something isn't working

Comments

@ilyagr
Copy link

ilyagr commented Aug 28, 2022

Description of the bug

  1. Be on a public commit (main branch).
  2. Do git reword.

Expected behavior

You get an error message telling you to use the --force-rewrite option.

Actual behavior

The editor opens, lets you edit the commit message. After saving the message, you get an error message and the edits are lost.

Moreover, the message tells you to use an --force option, which doesn't exist.

The exact error I got:

You are trying to rewrite 1 public commit, such as: 51298b4 Instead of c_restow, try c.restow
It is generally not advised to rewrite public commits, because your
collaborators will have difficulty merging your changes.
Retry with -f/--force to proceed anyways.

Version of rustc

No response

Automated bug report

Software version

git-branchless 0.4.0 (v0.3.6-nixos.0-494-gedb6e91)

Operating system

Linux 5.10.120-16471-g167ad2e5dcba

Command-line

git-branchless_dev bug-report 

Environment variables

SHELL=/usr/bin/fish
EDITOR=vim

Git version

> git version 
git version 2.30.2

Hooks

Show 6 hooks
Hook post-commit
#!/bin/sh
## START BRANCHLESS CONFIG

git branchless hook-post-commit "$@"

## END BRANCHLESS CONFIG
Hook post-merge
#!/bin/sh
## START BRANCHLESS CONFIG

git branchless hook-post-merge "$@"

## END BRANCHLESS CONFIG
Hook post-rewrite
#!/bin/sh
## START BRANCHLESS CONFIG

git branchless hook-post-rewrite "$@"

## END BRANCHLESS CONFIG
Hook post-checkout
#!/bin/sh
## START BRANCHLESS CONFIG

git branchless hook-post-checkout "$@"

## END BRANCHLESS CONFIG
Hook pre-auto-gc
#!/bin/sh
## START BRANCHLESS CONFIG

git branchless hook-pre-auto-gc "$@"

## END BRANCHLESS CONFIG
Hook reference-transaction
#!/bin/sh
## START BRANCHLESS CONFIG

# Avoid canceling the reference transaction in the case that `branchless` fails
# for whatever reason.
git branchless hook-reference-transaction "$@" || (
echo 'branchless: Failed to process reference transaction!'
echo 'branchless: Some events (e.g. branch updates) may have been lost.'
echo 'branchless: This is a bug. Please report it.'
)

## END BRANCHLESS CONFIG

Events

Show 5 events
Event ID: 238, transaction ID: 991 (message: hide)
  1. ObsoleteEvent { timestamp: 1661646039.3376951, event_tx_id: EventTransactionId(991), commit_oid: NonZeroOid(901f990cf5816bbe8519ac98a913be2a520f5d05) }
  2. ObsoleteEvent { timestamp: 1661646039.3376951, event_tx_id: EventTransactionId(991), commit_oid: NonZeroOid(b0eb5dcfd556018e5db3ea0725e8530e0eb730dd) }
  3. ObsoleteEvent { timestamp: 1661646039.3376951, event_tx_id: EventTransactionId(991), commit_oid: NonZeroOid(84ad5109376996ac9a3a28a01ed042c3978c8fad) }
  4. ObsoleteEvent { timestamp: 1661646039.3376951, event_tx_id: EventTransactionId(991), commit_oid: NonZeroOid(7244e1081ab525dc9d2be9d9391518b89dae94d8) }
  5. ObsoleteEvent { timestamp: 1661646039.3376951, event_tx_id: EventTransactionId(991), commit_oid: NonZeroOid(f9689c1f2db03870e4fe43079bcdb28dd565d85c) }
  6. ObsoleteEvent { timestamp: 1661646039.3376951, event_tx_id: EventTransactionId(991), commit_oid: NonZeroOid(85b3f46b9855600799f3ac8749d688f02bef2320) }
  7. ObsoleteEvent { timestamp: 1661646039.3376951, event_tx_id: EventTransactionId(991), commit_oid: NonZeroOid(d1905c643e774abe7029c9c3a35c2ffd156d66a0) }
  8. ObsoleteEvent { timestamp: 1661646039.3376951, event_tx_id: EventTransactionId(991), commit_oid: NonZeroOid(9a41b9d96fda8de3bcc5cca6f7c27ebb2c13ead3) }
  9. ObsoleteEvent { timestamp: 1661646039.3376951, event_tx_id: EventTransactionId(991), commit_oid: NonZeroOid(a90236a1e3b9f2a9f38624d4a56899bb29a85fa9) }
:
O f9d37fd 1y xxxxxxxxxxxxx xxxxxxxxx
|\
: o 2c2e01f 1y (redacted-ref-0) xxxxxxx
:
O 203eb07 1y xxxxxx xxxxxxxxx
|\
: o 33368fc 15m xxx xx xxx xxxxx xxxx
: |
: o eff2aeb 15m xxxx xxxxxxx xxxxxxx
: |
: o 43d58a0 15m xxxxx xxxx xxxxx
: |
: o 9ee968a 15m xxxxxx xxxxxxxxx x xxxxxxx
: |
: o f67646c 15m xxxx xxxxxxxxxx xx xxxxxxxxxxxxxxxxxx
: |
: o 2c52457 15m xxxxxxxxx
: |
: o 77a2545 15m xxxx xxxxxxxxx
: |
: o 6459e14 15m xxxx
: |
: o 26677fb 15m xxxx xxx xxxxxxxxx
: |
: o ec3106f 15m xxxxxxxx xxxxx xxxxx xxxxxx
: |
: o 75e76c4 15m xxxxxxx xx xxxxx xxxxx
: |
: o 59b684d 15m xxxx xxxxxx xxx x xxxxxxx xxxxxxxxxxx
: |
: o 26b4a60 15m xxx xxx xxxx xxxxxxxxxxxx xxxxxx
: |
: o 564e98d 14m xxxx xxxxxxxx
: |
: o b47acc2 14m xxxxxxxx xxx xxxx
: |
: o 0459f8c 14m xxxx xxxx xxxxxxx
: |
: o cd72f1e 14m xxxx
:
O 5b87cf4 1y xxxx xxxxxxx xxxxxxx
|\
| o 086af61 1y (redacted-ref-1) xxx xxxxxxx xxxxx
|\
: o 3de8449 1y (redacted-ref-2) xxxxxx xxxxxx
:
O 52e228b 1y xxxx xxxxxxxxxx xx xxxxxxxxxxxxxxxxxx
|\
| o d5cabf1 1y xxxxxxxxx
| |
| o 3496d15 1y (redacted-ref-3) xxxx
|
O b4a5670 1y xxxxxxxxx
|\
: o 28dac6f 1y xxxxxxx xxx xxxx xx
: |
: o 2009b61 1y xxxxxx xxxxxxxxx
: |
: o 710c199 1y xxxxx xxxxxx
: |
: o 64cf677 1y xxxx xxxxxx
: |
: o 7d8a0b5 1y (redacted-ref-4) xxxxxx xxxxxx
:
O 0785bdf 1y xxxxx xxxxx
|\
: o fdbc603 1y (redacted-ref-5) xx xxxxxxxxx
:
O 083db6b 104d xxxxx xxxxxx
|\
: o ae9ffe3 104d (redacted-ref-6) xxxxxxxx xxxxxxx
:
O aa795d2 97d xxxx xxxxxx xxxxxxxxxx x xxxx xxxx
|\
: o d0badf6 97d (redacted-ref-7) xxxx xxxxx xxx xxxx
:
O a4a51c3 14m xxx xxxx xxxx xxxxxx
|\
: o 461c683 7m (redacted-ref-8) xxxxxxxxxxx xxxxxxxx xx xxx xxxxxxxxxxxxxxx xx xx
:
@ 51298b4 14m (redacted-ref-9, remote origin/main) xxxxxxx xx xxxxxxxxx xxx xxxxxxxx
Event ID: 234, transaction ID: 987 (message: move)
  1. RefUpdateEvent { timestamp: 1661646003.0112278, event_tx_id: EventTransactionId(987), ref_name: "refs/heads/redacted-ref-8", old_oid: 7842f3b4245efb9441dccfcacd4b409cc51e3f1e, new_oid: 461c683c214fd023e66caaa8f0ca79df47e7b69c, message: None }
  2. RewriteEvent { timestamp: 1661646003.1750474, event_tx_id: EventTransactionId(987), old_commit_oid: 7842f3b4245efb9441dccfcacd4b409cc51e3f1e, new_commit_oid: 461c683c214fd023e66caaa8f0ca79df47e7b69c }
  3. WorkingCopySnapshot { timestamp: 1661646003.2148836, event_tx_id: EventTransactionId(987), head_oid: 51298b485b9737a7d121d3febef3d9961a267d9e, commit_oid: NonZeroOid(fff1dcfc54ead137818ad556a8c0c52963fb2f8a), ref_name: None }
  4. RefUpdateEvent { timestamp: 1661646003.2996902, event_tx_id: EventTransactionId(987), ref_name: "HEAD", old_oid: 51298b485b9737a7d121d3febef3d9961a267d9e, new_oid: 51298b485b9737a7d121d3febef3d9961a267d9e, message: None }
:
O f9d37fd 1y xxxxxxxxxxxxx xxxxxxxxx
|\
: o 2c2e01f 1y (redacted-ref-0) xxxxxxx
:
O 203eb07 1y xxxxxx xxxxxxxxx
|\
: o 33368fc 15m xxx xx xxx xxxxx xxxx
: |
: o eff2aeb 15m xxxx xxxxxxx xxxxxxx
: |
: o 43d58a0 15m xxxxx xxxx xxxxx
: |
: o 9ee968a 15m xxxxxx xxxxxxxxx x xxxxxxx
: |
: o f67646c 15m xxxx xxxxxxxxxx xx xxxxxxxxxxxxxxxxxx
: |
: o 2c52457 15m xxxxxxxxx
: |
: o 77a2545 15m xxxx xxxxxxxxx
: |
: o 6459e14 15m xxxx
: |
: o 26677fb 15m xxxx xxx xxxxxxxxx
: |
: o ec3106f 15m xxxxxxxx xxxxx xxxxx xxxxxx
: |
: o 75e76c4 15m xxxxxxx xx xxxxx xxxxx
: |
: o 59b684d 15m xxxx xxxxxx xxx x xxxxxxx xxxxxxxxxxx
: |
: o 26b4a60 15m xxx xxx xxxx xxxxxxxxxxxx xxxxxx
: |
: o 564e98d 14m xxxx xxxxxxxx
: |
: o b47acc2 14m xxxxxxxx xxx xxxx
: |
: o 0459f8c 14m xxxx xxxx xxxxxxx
: |
: o cd72f1e 14m xxxx
:
O 5b87cf4 1y xxxx xxxxxxx xxxxxxx
|\
| o 086af61 1y (redacted-ref-1) xxx xxxxxxx xxxxx
|\
: o 3de8449 1y (redacted-ref-2) xxxxxx xxxxxx
:
O 52e228b 1y xxxx xxxxxxxxxx xx xxxxxxxxxxxxxxxxxx
|\
| o d5cabf1 1y xxxxxxxxx
| |
| o 3496d15 1y (redacted-ref-3) xxxx
|
O b4a5670 1y xxxxxxxxx
|\
: o 28dac6f 1y xxxxxxx xxx xxxx xx
: |
: o 2009b61 1y xxxxxx xxxxxxxxx
: |
: o 710c199 1y xxxxx xxxxxx
: |
: o 64cf677 1y xxxx xxxxxx
: |
: o 7d8a0b5 1y (redacted-ref-4) xxxxxx xxxxxx
:
O 0785bdf 1y xxxxx xxxxx
|\
: o fdbc603 1y (redacted-ref-5) xx xxxxxxxxx
:
O 083db6b 104d xxxxx xxxxxx
|\
: o ae9ffe3 104d (redacted-ref-6) xxxxxxxx xxxxxxx
:
O aa795d2 97d xxxx xxxxxx xxxxxxxxxx x xxxx xxxx
|\
: o d0badf6 97d (redacted-ref-7) xxxx xxxxx xxx xxxx
:
O a4a51c3 14m xxx xxxx xxxx xxxxxx
|\
: o 461c683 7m (redacted-ref-8) xxxxxxxxxxx xxxxxxxx xx xxx xxxxxxxxxxxxxxx xx xx
:
@ 51298b4 14m (redacted-ref-9, remote origin/main) xxxxxxx xx xxxxxxxxx xxx xxxxxxxx
Event ID: 233, transaction ID: 966 (message: pushf)
  1. RefUpdateEvent { timestamp: 1661645611.1930046, event_tx_id: EventTransactionId(966), ref_name: "refs/remotes/origin/main", old_oid: 0000000000000000000000000000000000000000, new_oid: 51298b485b9737a7d121d3febef3d9961a267d9e, message: None }
:
O f9d37fd 1y xxxxxxxxxxxxx xxxxxxxxx
|\
: o 2c2e01f 1y (redacted-ref-0) xxxxxxx
:
O 203eb07 1y xxxxxx xxxxxxxxx
|\
: o 33368fc 15m xxx xx xxx xxxxx xxxx
: |
: o eff2aeb 15m xxxx xxxxxxx xxxxxxx
: |
: o 43d58a0 15m xxxxx xxxx xxxxx
: |
: o 9ee968a 15m xxxxxx xxxxxxxxx x xxxxxxx
: |
: o f67646c 15m xxxx xxxxxxxxxx xx xxxxxxxxxxxxxxxxxx
: |
: o 2c52457 15m xxxxxxxxx
: |
: o 77a2545 15m xxxx xxxxxxxxx
: |
: o 6459e14 15m xxxx
: |
: o 26677fb 15m xxxx xxx xxxxxxxxx
: |
: o ec3106f 15m xxxxxxxx xxxxx xxxxx xxxxxx
: |
: o 75e76c4 15m xxxxxxx xx xxxxx xxxxx
: |
: o 59b684d 15m xxxx xxxxxx xxx x xxxxxxx xxxxxxxxxxx
: |
: o 26b4a60 15m xxx xxx xxxx xxxxxxxxxxxx xxxxxx
: |
: o 564e98d 14m xxxx xxxxxxxx
: |
: o b47acc2 14m xxxxxxxx xxx xxxx
: |
: o 0459f8c 14m xxxx xxxx xxxxxxx
: |
: o cd72f1e 14m xxxx
:
O 5b87cf4 1y xxxx xxxxxxx xxxxxxx
|\
| o 086af61 1y (redacted-ref-1) xxx xxxxxxx xxxxx
|\
: o 3de8449 1y (redacted-ref-2) xxxxxx xxxxxx
:
O 52e228b 1y xxxx xxxxxxxxxx xx xxxxxxxxxxxxxxxxxx
|\
| o d5cabf1 1y xxxxxxxxx
| |
| o 3496d15 1y (redacted-ref-3) xxxx
|
O b4a5670 1y xxxxxxxxx
|\
: o 28dac6f 1y xxxxxxx xxx xxxx xx
: |
: o 2009b61 1y xxxxxx xxxxxxxxx
: |
: o 710c199 1y xxxxx xxxxxx
: |
: o 64cf677 1y xxxx xxxxxx
: |
: o 7d8a0b5 1y (redacted-ref-4) xxxxxx xxxxxx
:
O 0785bdf 1y xxxxx xxxxx
|\
: o fdbc603 1y (redacted-ref-5) xx xxxxxxxxx
:
O 083db6b 104d xxxxx xxxxxx
|\
: o ae9ffe3 104d (redacted-ref-6) xxxxxxxx xxxxxxx
:
O aa795d2 97d xxxx xxxxxx xxxxxxxxxx x xxxx xxxx
|\
: o d0badf6 97d (redacted-ref-7) xxxx xxxxx xxx xxxx
:
O a4a51c3 14m xxx xxxx xxxx xxxxxx
|\
: o 461c683 7m (redacted-ref-8) xxxxxxxxxxx xxxxxxxx xx xxx xxxxxxxxxxxxxxx xx xx
:
@ 51298b4 14m (redacted-ref-9, remote origin/main) xxxxxxx xx xxxxxxxxx xxx xxxxxxxx
Event ID: 231, transaction ID: 964 (message: revise)
  1. RefUpdateEvent { timestamp: 1661645605.2085924, event_tx_id: EventTransactionId(964), ref_name: "refs/heads/redacted-ref-9", old_oid: a90236a1e3b9f2a9f38624d4a56899bb29a85fa9, new_oid: 51298b485b9737a7d121d3febef3d9961a267d9e, message: None }
  2. RefUpdateEvent { timestamp: 1661645605.2085924, event_tx_id: EventTransactionId(964), ref_name: "HEAD", old_oid: a90236a1e3b9f2a9f38624d4a56899bb29a85fa9, new_oid: 51298b485b9737a7d121d3febef3d9961a267d9e, message: None }
:
O f9d37fd 1y xxxxxxxxxxxxx xxxxxxxxx
|\
: o 2c2e01f 1y (redacted-ref-0) xxxxxxx
:
O 203eb07 1y xxxxxx xxxxxxxxx
|\
: o 33368fc 15m xxx xx xxx xxxxx xxxx
: |
: o eff2aeb 15m xxxx xxxxxxx xxxxxxx
: |
: o 43d58a0 15m xxxxx xxxx xxxxx
: |
: o 9ee968a 15m xxxxxx xxxxxxxxx x xxxxxxx
: |
: o f67646c 15m xxxx xxxxxxxxxx xx xxxxxxxxxxxxxxxxxx
: |
: o 2c52457 15m xxxxxxxxx
: |
: o 77a2545 15m xxxx xxxxxxxxx
: |
: o 6459e14 15m xxxx
: |
: o 26677fb 15m xxxx xxx xxxxxxxxx
: |
: o ec3106f 15m xxxxxxxx xxxxx xxxxx xxxxxx
: |
: o 75e76c4 15m xxxxxxx xx xxxxx xxxxx
: |
: o 59b684d 15m xxxx xxxxxx xxx x xxxxxxx xxxxxxxxxxx
: |
: o 26b4a60 15m xxx xxx xxxx xxxxxxxxxxxx xxxxxx
: |
: o 564e98d 14m xxxx xxxxxxxx
: |
: o b47acc2 14m xxxxxxxx xxx xxxx
: |
: o 0459f8c 14m xxxx xxxx xxxxxxx
: |
: o cd72f1e 14m xxxx
:
O 5b87cf4 1y xxxx xxxxxxx xxxxxxx
|\
| o 086af61 1y (redacted-ref-1) xxx xxxxxxx xxxxx
|\
: o 3de8449 1y (redacted-ref-2) xxxxxx xxxxxx
:
O 52e228b 1y xxxx xxxxxxxxxx xx xxxxxxxxxxxxxxxxxx
|\
| o d5cabf1 1y xxxxxxxxx
| |
| o 3496d15 1y (redacted-ref-3) xxxx
|
O b4a5670 1y xxxxxxxxx
|\
: o 28dac6f 1y xxxxxxx xxx xxxx xx
: |
: o 2009b61 1y xxxxxx xxxxxxxxx
: |
: o 710c199 1y xxxxx xxxxxx
: |
: o 64cf677 1y xxxx xxxxxx
: |
: o 7d8a0b5 1y (redacted-ref-4) xxxxxx xxxxxx
:
O 0785bdf 1y xxxxx xxxxx
|\
: o fdbc603 1y (redacted-ref-5) xx xxxxxxxxx
:
O 083db6b 104d xxxxx xxxxxx
|\
: o ae9ffe3 104d (redacted-ref-6) xxxxxxxx xxxxxxx
:
O aa795d2 97d xxxx xxxxxx xxxxxxxxxx x xxxx xxxx
|\
: o d0badf6 97d (redacted-ref-7) xxxx xxxxx xxx xxxx
:
O a4a51c3 14m xxx xxxx xxxx xxxxxx
|\
: o 461c683 7m (redacted-ref-8) xxxxxxxxxxx xxxxxxxx xx xxx xxxxxxxxxxxxxxx xx xx
:
@ 51298b4 14m (redacted-ref-9, remote origin/main) xxxxxxx xx xxxxxxxxx xxx xxxxxxxx
Event ID: 230, transaction ID: 960 (message: rebase)
  1. RefUpdateEvent { timestamp: 1661645570.2667537, event_tx_id: EventTransactionId(960), ref_name: "refs/heads/redacted-ref-9", old_oid: 0000000000000000000000000000000000000000, new_oid: a90236a1e3b9f2a9f38624d4a56899bb29a85fa9, message: None }
:
O f9d37fd 1y xxxxxxxxxxxxx xxxxxxxxx
|\
: o 2c2e01f 1y (redacted-ref-0) xxxxxxx
:
O 203eb07 1y xxxxxx xxxxxxxxx
|\
: o 33368fc 15m xxx xx xxx xxxxx xxxx
: |
: o eff2aeb 15m xxxx xxxxxxx xxxxxxx
: |
: o 43d58a0 15m xxxxx xxxx xxxxx
: |
: o 9ee968a 15m xxxxxx xxxxxxxxx x xxxxxxx
: |
: o f67646c 15m xxxx xxxxxxxxxx xx xxxxxxxxxxxxxxxxxx
: |
: o 2c52457 15m xxxxxxxxx
: |
: o 77a2545 15m xxxx xxxxxxxxx
: |
: o 6459e14 15m xxxx
: |
: o 26677fb 15m xxxx xxx xxxxxxxxx
: |
: o ec3106f 15m xxxxxxxx xxxxx xxxxx xxxxxx
: |
: o 75e76c4 15m xxxxxxx xx xxxxx xxxxx
: |
: o 59b684d 15m xxxx xxxxxx xxx x xxxxxxx xxxxxxxxxxx
: |
: o 26b4a60 15m xxx xxx xxxx xxxxxxxxxxxx xxxxxx
: |
: o 564e98d 14m xxxx xxxxxxxx
: |
: o b47acc2 14m xxxxxxxx xxx xxxx
: |
: o 0459f8c 14m xxxx xxxx xxxxxxx
: |
: o cd72f1e 14m xxxx
:
O 5b87cf4 1y xxxx xxxxxxx xxxxxxx
|\
| o 086af61 1y (redacted-ref-1) xxx xxxxxxx xxxxx
|\
: o 3de8449 1y (redacted-ref-2) xxxxxx xxxxxx
:
O 52e228b 1y xxxx xxxxxxxxxx xx xxxxxxxxxxxxxxxxxx
|\
| o d5cabf1 1y xxxxxxxxx
| |
| o 3496d15 1y (redacted-ref-3) xxxx
|
O b4a5670 1y xxxxxxxxx
|\
: o 28dac6f 1y xxxxxxx xxx xxxx xx
: |
: o 2009b61 1y xxxxxx xxxxxxxxx
: |
: o 710c199 1y xxxxx xxxxxx
: |
: o 64cf677 1y xxxx xxxxxx
: |
: o 7d8a0b5 1y (redacted-ref-4) xxxxxx xxxxxx
:
O 0785bdf 1y xxxxx xxxxx
|\
: o fdbc603 1y (redacted-ref-5) xx xxxxxxxxx
:
O 083db6b 104d xxxxx xxxxxx
|\
: o ae9ffe3 104d (redacted-ref-6) xxxxxxxx xxxxxxx
:
O aa795d2 97d xxxx xxxxxx xxxxxxxxxx x xxxx xxxx
|\
: o d0badf6 97d (redacted-ref-7) xxxx xxxxx xxx xxxx
:
O a4a51c3 14m xxx xxxx xxxx xxxxxx
|\
: o 461c683 7m (redacted-ref-8) xxxxxxxxxxx xxxxxxxx xx xxx xxxxxxxxxxxxxxx xx xx
:
@ 51298b4 14m (redacted-ref-9, remote origin/main) xxxxxxx xx xxxxxxxxx xxx xxxxxxxx

Version of git-branchless

No response

Version of git

No response

@ilyagr ilyagr added the bug Something isn't working label Aug 28, 2022
@ilyagr ilyagr changed the title git reword on a public commit loses the message edits, wrong hint git reword on a public commit loses the message edits, wrong hint in error message Aug 28, 2022
@ilyagr
Copy link
Author

ilyagr commented Aug 28, 2022

The editor message is similarly lost if you try to reword a merge commit.

@claytonrcarter
Copy link
Collaborator

Hi @ilyagr. Thanks for this report.

I've opened #518 to fix the incorrect option name.

As for losing the message edits, I think the best easiest way for us to work around that will be to address #475 and start using .git/COMMIT_EDITMSG for the editor messages. (As currently implemented, we only save the edited messages if there is a problem with the message itself (mostly just different commits going into the message than are found coming out of it) and we're not able to (easily) do so later in the operation, such as when we're building or executing the rebase plan.) If the messages are always edited in the known, standard location, then it will be much easier to recover work in case of errors.

@arxanas
Copy link
Owner

arxanas commented Sep 1, 2022

Thanks for reporting. Besides better reword commit message recovery, it would probably be best to verify the rebase plan before prompting the user for a commit message. Currently, we only verify the rebase plan as part of trying to execute it. The best approach is probably either

  • Create a dummy rebase plan (i.e. one that rewrites every affected commit as itself) and then either see if execution succeeds or if some verify method passes.
  • Just separate out the verification from the rebase plan execution. Maybe combining them was a bad idea.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants