smartlog
, hide
and branches
#283
Replies: 2 comments 10 replies
-
This is all on-topic. It's unfortunately turned out that the name "git-branchless" is a bad one, since so many people preface their issues with "I'm using a branch-based workflow but..." when in fact git-branchless fully supports branch-based workflows. I'm open to other names, but unfortunately, I haven't come up with a good one, considering there's no obvious unifying theme between "branchlessness"/"in-memory rebases"/"undo"/etc.
In the long-term, we'd probably want to support revsets (#175) and be able to write something like git-branchless/src/commands/smartlog.rs Lines 219 to 226 in 496ad07 It would have to support walking only from commits with branches pointing to them, instead of all public commits. That information is already in the passed-in git-branchless/src/core/dag.rs Lines 78 to 86 in 3c88340 So you would just need to make an alternative to this function which only queries branch heads, and use that: git-branchless/src/core/dag.rs Lines 361 to 365 in 3c88340
This also hits me when I just want to delete a branch. It might instead be best to make it so that It would be nice to do something automatically when a branch is deleted, but even though we can observe the branch disappearing, it's not really possible to tell what the user (or tool!) intent might have been. There's also an unfortunate issue in most recent versions of Git where the
Rather than prevent the hide operation, I think it would be better to surface a warning with remediation steps:
We should remove the help text from (If it wasn't clear, you can actually run |
Beta Was this translation helpful? Give feedback.
-
One solution is to attach change IDs to the commit messages, so that it has a field like
in the commit message somewhere. Assuming that the commit messages for squash-merges are all combined, then it should be possible to use that for commit deduplication. Would that work for you? I think there are other solutions that should be explored as well to detect squash merges automatically. Since most users merge stuff at the bottom of a stack, you could calculate O(n) extra commits starting from the first commit and spanning to the second, to the third, etc., and see if any of those would duplicate an upstream commit, which might still scale reasonably well in practice. |
Beta Was this translation helpful? Give feedback.
-
I'm getting a lot of usage and value out of this, even those it's called
branchless
and I'm feeling like my workflow isbranchmore
much of the time. 😄 So, I may be suggesting things that are out of scope for this tool; please forgive me if I am.Here's a couple of things that would have been handy recently:
smartlog
flag to only show commit trees that have branches on them. For example:hide
commits when an unmerged branch is manually deleted (eggit branch -D my-branch
) because manually deleted an unmerged branch is likely to mean that you want to abandon/discard those commits as well. This happens for me b/c we do a log of GitLab MRs w/ lots of commits that end up being squashed @ merge, but those commits still hang around, haunting mysmartlog
.smartlog
for # 2 above, and copy-pasting the wrong commits intogit hide -r
. Here's a possible example/suggestion:Do any of these seem like they make sense in this tool?
Beta Was this translation helpful? Give feedback.
All reactions