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

error when killing a branch that has a shipped parent after "git skip" #2978

Closed
kevgo opened this issue Jan 15, 2024 · 4 comments
Closed

error when killing a branch that has a shipped parent after "git skip" #2978

kevgo opened this issue Jan 15, 2024 · 4 comments
Labels
Milestone

Comments

@kevgo
Copy link
Contributor

kevgo commented Jan 15, 2024

  • I have branch kg-fix-switch and its child branch kg-test
  • I have just shipped branch kg-fix-switch at the remote
  • I have run git sync. It has deleted my local kg-fix-switch branch but ran into merge conflicts for branch kg-test. I ran git town skip to skip resolving these merge conflicts because I want to delete branch kg-test.
  • I now have branch kg-test checked out
  • I run git kill

expected behavior: it kills branch kg-test

actual behavior: I get this error:

[kg-test] git fetch --prune --tags

[kg-test] git push origin :kg-test
To github.com:git-town/git-town.git
 - [deleted]           kg-test

[kg-test] git checkout kg-sort-linter
Switched to branch 'kg-sort-linter'
Your branch is up to date with 'origin/kg-sort-linter'.


Error: cannot determine if branch "kg-test" has unmerged commits: 
----------------------------------------
Diagnostic information of failed command

COMMAND: git log kg-fix-switch..kg-test
ERROR: exit status 128
OUTPUT START
fatal: ambiguous argument 'kg-fix-switch..kg-test': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'

OUTPUT END
----------------------------------------

To continue after having resolved conflicts, run "git-town continue".
To go back to where you started, run "git-town undo".
@kevgo kevgo added the bug label Jan 15, 2024
@kevgo
Copy link
Contributor Author

kevgo commented Jan 15, 2024

The problem is that in order to determine whether kg-test has unmerged commits, it diffs this branch against its former parent (kg-fix-switch). This branch no longer exists, causing the error. It should diff against the new parent of kg-test, which is main.

@kevgo
Copy link
Contributor Author

kevgo commented Jan 15, 2024

When git kill ran, it must have had old lineage information. This means git sync didn't update the lineage when removing the shipped branch.

@kevgo
Copy link
Contributor Author

kevgo commented Jan 15, 2024

This is hitting an edge case where "git-town skip" doesn't work anymore: when "git sync" deletes a remotely shipped branch. The implementation of "git town skip" relies on assumptions that are no longer true when "git sync" deletes branches. This sparsely used command should have been removed when the "git sync" changes shipped, since it incentivizes anti-patterns like leaving particular branches unsynced.

@kevgo kevgo added this to the v12 milestone Jan 18, 2024
@kevgo kevgo changed the title error when killing a branch that has a shipped parent error when killing a branch that has a shipped parent after "git skip" Feb 2, 2024
@kevgo kevgo modified the milestones: v12, v12.1 Feb 5, 2024
@kevgo
Copy link
Contributor Author

kevgo commented Feb 21, 2024

This is fixed now.

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

No branches or pull requests

1 participant