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 bisect leaves "should not appear" transactions in undo log #57

Closed
waych opened this issue Jul 3, 2021 · 4 comments · Fixed by #80
Closed

git bisect leaves "should not appear" transactions in undo log #57

waych opened this issue Jul 3, 2021 · 4 comments · Fixed by #80
Labels
bug Something isn't working enhancement New feature or request

Comments

@waych
Copy link
Contributor

waych commented Jul 3, 2021

I did a bisect in my local dev tree yesterday, and noticed various transactions in git undo that have the following message:

This event should not appear. This is a (benign) bug -- please report it.

I don't think bisect is a workflow that has been completely worked out for transactions yet?

Roughly looks like this (replacing commit ids and names with ... throughout):

1. Empty event for ref BISECT_HEAD
   This event should not appear. This is a (benign) bug -- please report it.

at the start of the bisection, and later, after I did the bisection and screwed something up (resulting in a commit that was both good and bad) I did a git bisect reset, resulting in the following:

                1. Delete ref refs/bisect/bad at ...

                2. Delete ref refs/bisect/good-...

                3. Delete ref refs/bisect/good-...

                4. Delete ref refs/bisect/good-...

                5. Delete ref refs/bisect/good-...

                6. Delete ref refs/bisect/good-...

                7. Delete ref refs/bisect/good-...

                8. Delete ref refs/bisect/good-...

                9. Empty event for ref BISECT_HEAD
                   This event should not appear. This is a (benign) bug -- please report it.

followed by other transactions that looked like:

1. Empty event for ref refs/bisect/bad
    This event should not appear. This is a (benign) bug -- please report it

or

1. Empty event for ref refs/bisect/good-...
    This event should not appear. This is a (benign) bug -- please report it.

one for each of the good / bad refs. Finally finishing with:

1. Empty event for ref BISECT_HEAD
    This event should not appear. This is a (benign) bug -- please report it.
@arxanas
Copy link
Owner

arxanas commented Jul 3, 2021

Thanks for reporting. I'll look into the bisect workflow later.

I'm wondering if it needs to be added here:

Some("ORIG_HEAD" | "CHERRY_PICK" | "REBASE_HEAD" | "CHERRY_PICK_HEAD" | "FETCH_HEAD")

Or maybe we just shouldn't warn for the case of bisect refs being empty.

EDIT: ah, I didn't realize that there are different refs for each good commit.

@arxanas arxanas added bug Something isn't working enhancement New feature or request labels Jul 6, 2021
@arxanas
Copy link
Owner

arxanas commented Jul 14, 2021

It looks like stashes would also be affected:

The latest stash you created is stored in refs/stash; older stashes are found in the reflog of this reference

Although ideally, under the branchless workflow, you wouldn't use stashes to begin with.

From a UX perspective, it probably makes sense to have different timelines for branches, bisects and stashes, but I'm not sure how we would represent that in the UI.

arxanas added a commit that referenced this issue Aug 20, 2021
Closes #57. Some operations, such as bisecting and stashing, use references in an unconventional way. These are reported as if there is no change to the content of the reference, which might happen e.g. if instead the reflog for that reference was changed, or if it was touched but left unchanged.

These uses for references don't really affect the commit graph. Ideally, we would handle them entirely differently. They should have an entirely separate history, and it should be possible to rewind them separately from the commit graph's history. For example, you should be able to unmark a certain commit during a bisect operation without affecting any commits you may have made since starting the bisect.

The UI for this would need to be considered thoughtfully. Since this isn't too common of a use-case for now, I'm updating this message to just warn that it may be an unsupported use-case, and deferring it the alternative UI for later.
arxanas added a commit that referenced this issue Aug 20, 2021
Closes #57. Some operations, such as bisecting and stashing, use references in an unconventional way. These are reported as if there is no change to the content of the reference, which might happen e.g. if instead the reflog for that reference was changed, or if it was touched but left unchanged.

These uses for references don't really affect the commit graph. Ideally, we would handle them entirely differently. They should have an entirely separate history, and it should be possible to rewind them separately from the commit graph's history. For example, you should be able to unmark a certain commit during a bisect operation without affecting any commits you may have made since starting the bisect.

The UI for this would need to be considered thoughtfully. Since this isn't too common of a use-case for now, I'm updating this message to just warn that it may be an unsupported use-case, and deferring it the alternative UI for later.
arxanas added a commit that referenced this issue Aug 20, 2021
Closes #57. Some operations, such as bisecting and stashing, use references in an unconventional way. These are reported as if there is no change to the content of the reference, which might happen e.g. if instead the reflog for that reference was changed, or if it was touched but left unchanged.

These uses for references don't really affect the commit graph. Ideally, we would handle them entirely differently. They should have an entirely separate history, and it should be possible to rewind them separately from the commit graph's history. For example, you should be able to unmark a certain commit during a bisect operation without affecting any commits you may have made since starting the bisect.

The UI for this would need to be considered thoughtfully. Since this isn't too common of a use-case for now, I'm updating this message to just warn that it may be an unsupported use-case, and deferring it the alternative UI for later.
arxanas added a commit that referenced this issue Aug 20, 2021
Closes #57. Some operations, such as bisecting and stashing, use references in an unconventional way. These are reported as if there is no change to the content of the reference, which might happen e.g. if instead the reflog for that reference was changed, or if it was touched but left unchanged.

These uses for references don't really affect the commit graph. Ideally, we would handle them entirely differently. They should have an entirely separate history, and it should be possible to rewind them separately from the commit graph's history. For example, you should be able to unmark a certain commit during a bisect operation without affecting any commits you may have made since starting the bisect.

The UI for this would need to be considered thoughtfully. Since this isn't too common of a use-case for now, I'm updating this message to just warn that it may be an unsupported use-case, and deferring it the alternative UI for later.
@arxanas arxanas mentioned this issue Aug 20, 2021
27 tasks
@arxanas
Copy link
Owner

arxanas commented Aug 20, 2021

I've closed this for now by changing the bug message to link to this page, and I've added an item to #2 to track the issue of coming up with a better UI for undoing these kinds of events.

For future readers: if you're affected by this, you can leave a comment in this thread or post in Discussions.

@arxanas
Copy link
Owner

arxanas commented Oct 8, 2021

Besides the issue of git-bisect operations appearing in the event log, it occurs to me that it would probably be useful if you could carry out a bisect operation across the event log itself. For example, you may want to figure out which of your rebase operations introduced a regression. In that case, you might want to bisect across a slice of the timeline including events that touched a given commit or branch.

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

Successfully merging a pull request may close this issue.

2 participants