arxanas / git-branchless

High-velocity, monorepo-scale workflow for Git
Apache License 2.0
3.46k stars 87 forks source link

Regression: `git smartlog --hidden` is not showing hidden commits #633

Closed mlcui-corp closed 1 year ago

mlcui-corp commented 1 year ago

Description of the bug

After doing a few git syncs in a repo, git smartlog --hidden should show commits that were rewritten. However, at HEAD, git smartlog --hidden shows the same output as git smartlog.

The culprit commit is c90b52f5e1c379959952b59d2f2d0cc976ed4938. Specifically, creating a revert of it at fbe7766 fixes the issue (as I didn't want cargo to rebuild a lot of packages by going back that far).

$ cargo run -- smartlog --hidden
    Finished dev [unoptimized] target(s) in 15.03s
     Running `target/debug/git-branchless smartlog --hidden`
⋮
◆ fbe7766 1d feat(switch): change `--branch` to `--create`
┣━┓
⋮ ◯ 36f8895 4h Revert "refactor(dag): unify definition of commit visibility"
⋮
◇ ae3b28a 3h (master) perf(dag): select visible commits more efficiently

$ git sw 36f8895 
branchless: creating working copy snapshot
branchless: running command: git checkout 36f8895
Previous HEAD position was fbe7766 feat(switch): change `--branch` to `--create`
branchless: processing 1 update: ref HEAD
HEAD is now at 36f8895 Revert "refactor(dag): unify definition of commit visibility"
branchless: processing checkout
⋮
◇ fbe7766 1d feat(switch): change `--branch` to `--create`
┣━┓
⋮ ● 36f8895 4h Revert "refactor(dag): unify definition of commit visibility"
⋮
◇ ae3b28a 3h (master) perf(dag): select visible commits more efficiently

$ cargo run -- smartlog --hidden
    Finished dev [unoptimized] target(s) in 13.86s
     Running `target/debug/git-branchless smartlog --hidden`
⋮
◇ 96396b4 2d build: run `cargo update`
┣━┓
┃ ✕ d46f26c 2d (rewritten as 00000000) feat(switch): change `--branch` to `--create`
┣━┓
⋮ ✕ 5dcb303 2d (rewritten as 36f8895c) Revert "refactor(dag): unify definition of commit visibility"
⋮
◇ fbe7766 1d feat(switch): change `--branch` to `--create`
┣━┓
┃ ✕ 6351be8 6h (rewritten as 00000000) perf(dag): add `#[instrument]` to various revset evaluation functions
┃ ┃
┃ ✕ eee260a 6h (rewritten as 00000000) perf(dag): select visible commits more efficiently
┣━┓
⋮ ● 36f8895 4h Revert "refactor(dag): unify definition of commit visibility"
⋮
◇ ae3b28a 3h (master) perf(dag): select visible commits more efficiently

Expected behavior

git smartlog --hidden shows hidden commits.

Actual behavior

git smartlog --hidden does not show hidden commits.

Version of rustc

No response

Automated bug report

No response

Version of git-branchless

No response

Version of git

No response

arxanas commented 1 year ago

Oops, thanks for reporting. Can you see if #634 resolves the issue?

Do you use git smartlog --hidden as part of your normal workflow, or is it just to expose the issue?

mlcui-corp commented 1 year ago

Yep, I can confirm #634 fixes the issue.

Do you use git smartlog --hidden as part of your normal workflow, or is it just to expose the issue?

No, I don't use it as part of my normal workflow. I stumbled across this issue when I was demo-ing git-branchless to some coworkers who were familiar with Mercurial's changeset evolution workflow. git smartlog --hidden is a great way of demoing bitemporality, especially after a git sync, but it wasn't working (hence this bug report).

edit: To be exact, I stumbled across this before my demo (no buggy behaviour was demoed 😛). I instead used git commit --amend to create an abandoned commit, then git restack, to show bitemporality.

arxanas commented 1 year ago

To be exact, I stumbled across this before my demo

That's a relief 😂