-
Notifications
You must be signed in to change notification settings - Fork 328
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
Pretty OneLine Reversed #52
base: main
Are you sure you want to change the base?
Conversation
@@ -187,6 +187,9 @@ | |||
# log with one line per item. | |||
lo = log --oneline | |||
|
|||
# log with one line per item, reversed and pretty | |||
ol = log --oneline --reverse --abbrev-commit --decorate --date=relative --format=format:'%C(bold cyan)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(dim white)- %an%C(reset)%C(bold yellow)%d%C(reset)' -n 30 |
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.
We already have log --oneline --reverse
and in my opinion it's enough.
This alias has too many personal-style options. The colors suited for dark background but not light (at least not at my light grey terminal). Why --date=relative
? Why -n 30
? Why not 10 or 50?
My opinion is that such an alias is ok in your personal ~/.gitconfig
but not suitable for general public.
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.
Having a good one line log alias is a real help, especially those new to git. The default behaviour hides many salient features of the current status, particularly branch names. IMHO this is a useful behaviour. However, feel free to reject the PR if you do not wish to adopt it.
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.
As I'm just an occasional contributor and reviewer I can neither accept nor reject the PR.
Thanks Gavin! I agree with you that a good one line log alias is a real help for new users. The intent of the repo is to use I've experimented with two of your ideas for colors, dates, and number limits. For dates, what I found in practice is that word dates e.g. "2 weeks ago" tend to cause problems because they are relative. A typical example is if a user pastes a git log into an issue tracker, and a week later, someone else reads the tracker. To discover accurate dates, the reader needs to look up every commit date. This gets hairy if the original paste is a subset of a log, such as a git log that's piped to grep to select just some lines. So the teams changed to always use full dates in ISO format. We had similar experiments of what fields go in what order, and we found that date field first works the best for sorting on most systems, and topo-order works best for outputting the most-recent info at top. For colors, what I found in practice is that people care a lot about colors, and have a wide range of displays, and many of my teams have had someone who's color-blind. Unfortunately "bold" and "dim" colors do not work effectively across many displays. For example, I'm on a top of the line MacBook Pro, using iTerm2, and the default "dim white" color text is just barely visible and not readable effectively. For number limits, what I found in practice is that the ideal of most users is to use one screenful of information and with line count numbers at left. But at the same time, I see many users pipe to grep or other selecting tools. I haven't yet found a good way to do this (i.e. output one screen if the context is interactive, and output everything if the context is within a pipe) within a git alias, so instead the The intents of your See what you think of these ideas, and I would very much appreciate hearing your opinions about them. |
Thanks for the reply. I should also add that not all of us see colour equally and my choice of colours might not appeal to many. I will play with ll and see how it goes. |
00feb02
to
8a231a3
Compare
21f9e26
to
3b61131
Compare
99a600e
to
72ab030
Compare
This is my go to one line reversed pretty that also shows branches local and remote