-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Show refs in log in Gstatus #1713
base: master
Are you sure you want to change the base?
Conversation
0b70bb3
to
da134a4
Compare
I think we should probably match One thing I don't like is that |
autoload/fugitive.vim
Outdated
@@ -1701,14 +1701,14 @@ function! s:ReplaceCmd(cmd) abort | |||
endfunction | |||
|
|||
function! s:QueryLog(refspec) abort | |||
let lines = s:LinesError(['log', '-n', '256', '--pretty=format:%h%x09%s', a:refspec, '--'])[0] | |||
let lines = s:LinesError(['log', '-n', '256', '--pretty=format:%h%x09%s%x09%D', a:refspec, '--'])[0] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use %d
here as it's older. Parentheses can be stripped, or used wholesale in the format change I proposed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point. I've used the parenthesized refs directly, without stripping them only to reapply them later
c9f5633
to
1c8dc4d
Compare
Right, I've done that in the latest version.
The only thing that comes to my mind is to only show 2-3 refs, and add |
Poking around in some histories I occasionally see messages starting with
I'm inclined to explore solutions of the form "if we're in the |
1c8dc4d
to
6d3cbd1
Compare
I am experimenting with concealing. So far I have managed to add a Disregard the fact that the parentheses themselves are not shown. I will add them back in the final version. The thing I am worried about is that because I have added the concealed text, when using Also, if you've got a better idea for a character to disambiguate the refs parentheses (I've used
I suppose I can pass a list of refs to ignore when |
6d3cbd1
to
8797e3e
Compare
That's the correct behavior, and it's the biggest of the "tradeoffs" I alluded to. Another is that if you copy the line and paste it to another buffer, you'll see the concealed characters.
One idea is to prepend
Ignoring the parameter And just to make sure expectations are clear: I won't be merging until after the next stable release at the very earliest, and there are no guarantees I won't bail entirely. |
8797e3e
to
d566080
Compare
Good idea, I'll investigate it tomorrow
I've added a separate parameter to avoid hacks with splitting the
Sure thing, thanks for all the guidance and open communication |
Sounds like a job for |
That was a great tip, I've just implemented that: I've pushed that as a separate commit. If you'd like to merge the PR any time in the future, let me know if you'd prefer them squashed.
Thanks for the pointers again, I'll see what I can do. Overall, I'd like to thank you for the support so far. I feel I have learned a ton with this PR 🙂 |
After a few minutes of testing, looks like git log --decorate --decorate-refs-exclude='*origin/master' --all
git log --decorate --decorate-refs-exclude='refs/remotes/origin/master' --all I did not come up with a useful case for I have also experimented a bit with syntax highlighting only the refs, and not the commas in the refs list, but failed again. It either did not highlight anything at all or highlighted the whole line. I guess I'll leave it be for now |
I think we wanna exclude
The fix is another level of |
Thanks for a detailed answer. The rules make sense, I'll try to incorporate it sometime soon
I was trying to implement exactly this earlier today, but I think I overcomplicated it. I've managed to do it starting fresh. Thanks! |
Display refs (the output of %d from git log's format=pretty) next to commit summaries in Gstatus. Use basic syntax highlighting for all refs. Use a special marker and concealing to avoid false-positives when commit subjects begin with parentheses. Obvious refs (e.g. "HEAD", "origin/master" when showing unpulled changes from "origin/master") are hidden.
Subject lines that begin with an open parenthesis and have no other refs attached have their first parenthesised text syntax highlighted. Use concealed artificial parentheses in such cases.
Stop highlighting comma separators and arrows in the list of refs shown in Gstatus.
4aaf929
to
5bfbdaa
Compare
This is my attempt to close #1700. I have followed your advice and modified the functions you mentioned. Writing in VimScript was a new experience for me and I appreciate the fact that the change was relatively simple.
The PR adds displaying refs (the output of
%d
fromgit log
'sformat=pretty
) next to commit summaries inGstatus
.It uses basic syntax highlighting for all refs.
Examples