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

Use git ref instead of branch for stgit log #65

Closed
hborchardt opened this issue Aug 5, 2020 · 3 comments
Closed

Use git ref instead of branch for stgit log #65

hborchardt opened this issue Aug 5, 2020 · 3 comments

Comments

@hborchardt
Copy link
Contributor

I am having the problem that when viewing the repo state in SourceTree, my branch list is cluttered with the <mybranch>.stgit log entries from stgit (same argument as Issue #32).
Instead of not logging at all, would it be possible to not use a branch for the stgit log, but instead an abstract git ref like
refs/stgitlog/<mybranch>
to track the state of the log?

I did a quick test changing

return 'refs/heads/%s.stgit' % branch

to
return 'refs/stgitlog/%s.stgit' % branch
and as far as I can tell logging, undo, etc. works, as well as having a clean view in SourceTree.

I acknowledge that this would be a breaking change if just edited, so we might want to make the second part of the ref configurable.

If you could confirm that I am not missing anything and you would welcome such a change, I can give a shot at a pull request.

@hborchardt
Copy link
Contributor Author

I just read your answer in this issue: #24 (comment)
I have a feeling that the "old metadata system" refers to the .stgit branch, so waiting for your patch with stackformatversion 4 might solve my problems. If so, feel free to close this issue.

@jpgrayson
Copy link
Collaborator

Sorry for this delayed response.

To clarify: the old metadata system uses files found under .git/patches. The new metadata system uses git objects in the .stgit branches. This is contrary to your guess above.

Regarding the idea of using a non-branch ref for the log (metadata), this is actually something I have been considering doing. The reason you site (clutter when using graphical log tools; gitk and even git log --graph --all also have this issue) is one of the reasons we might want to use a non-branch ref. Other reasons include:

  • The .stgit branch can be considered "noise" when using git branch
  • Checking-out a .stgit branch is always a mistake (unless doing stgit development) and thus best to help users avoid this mistake
  • Individual patches already have refs found in .git/refs/patches/<branch>/.

The potential downsides of not keeping the metadata as a .stgit branch include:

  • The presence of this branch may be used by StGit users to know that a branch has been initialized (i.e. with stg init)
  • If we want to support distributed StGit metadata, i.e. pushing and pulling StGit stacks, it may be more intuitive to do this with regular git commands if the metadata is a regular branch.

I may be missing other pros/cons. My intent is to experiment with the usability of the metadata being located elsewhere. I was thinking either refs/stacks/<branch> or refs/stgit/<branch>.

@hborchardt
Copy link
Contributor Author

Much love for implementing this, thanks! ❤️

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

No branches or pull requests

2 participants