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

Hide refs/branchless/* refs by default from git log #171

Closed
krobelus opened this issue Oct 28, 2021 · 2 comments · Fixed by #186
Closed

Hide refs/branchless/* refs by default from git log #171

krobelus opened this issue Oct 28, 2021 · 2 comments · Fixed by #186
Assignees
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@krobelus
Copy link

As reported in jonas/tig#1160, git log --decorate (which is the default for git log) will add opaque references to branchless commits.

I'm not sure if there is a way to hide those references. I imagine the commits need to be referenced somewhere to evade garbage collection. Maybe there are other ways around that..

@martinvonz
Copy link
Collaborator

I think you can simply add something like this to your git config:

[log]
        excludeDecoration = refs/branchless/*

I suppose git-branchless init could add that to the repo-level config. I haven't checked if that * is recursive or not, or if that matters for git-branchless.

@arxanas
Copy link
Owner

arxanas commented Oct 28, 2021

Yep, we need to have the references for GC purposes. In principle it would be possible to substantially reduce the number of references by taking advantage of the fact that a commit keeps all of its ancestors live, but it would be rather complicated, and I don't want to risk that kind of thing in something as important as preventing commits from being GCed.

I think it should work to add a log.excludeDecoration pattern as part of git-branchless init, like @martinvonz says. We only store references at the top-level of refs/branchless/, so the above pattern should be fine.

@arxanas arxanas changed the title Should refs/branchless/* refs be hidden from "git log" and friends? Hide refs/branchless/* refs by default from git log Oct 28, 2021
@arxanas arxanas self-assigned this Oct 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants