-
Notifications
You must be signed in to change notification settings - Fork 18
Add sort by time #80
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
Add sort by time #80
Conversation
This is a small quality of life improvement, but comes naturally when allowing to sort by time.
|
I would like to add those options to be configurable in the |
|
Hey, thanks for looking into it. I wonder if the new options are really needed or if the default (and only) behaviour could be changed to always show date, always sort in descending order. I doubt anyone would really opt for the random order that happens now. My concern here is trying to keep the explosion of different options down where possible and some changes in output is probably better. The only thing that I absolutely don't want to break is the tab completion scripts and custom menu commands which rely on the hash being the first word of the output. So the date needs to shuffle to the end. |
|
I've now made the time come second in the line to be neatly below one another (I considered the EoL but that is a bit messy as commit message length influences that). This is how it looks now with the default picker: sort & reverse(git-fixup) ➜ git-fixup git:(add-sort-by-time) ✗ ./git-fixup -AS
1) c64094fea2f3f4d7d2a62e9937469ef9b796313a [F] fixup! feat: Allow displaying the commit time of fixup candidates <_email_>
2) 217c498dc613058e0bb873c2b495f610be96cecf [F] WIP <_email_>
(git-fixup) ➜ git-fixup git:(add-sort-by-time) ✗ ./git-fixup -ASr
1) 217c498dc613058e0bb873c2b495f610be96cecf [F] WIP <_email_>
2) c64094fea2f3f4d7d2a62e9937469ef9b796313a [F] fixup! feat: Allow displaying the commit time of fixup candidates <_email_>with time(git-fixup) ➜ git-fixup git:(add-sort-by-time) ✗ ./git-fixup -ASt
1) c64094fea2f3f4d7d2a62e9937469ef9b796313a 2025-01-03 12:36:27 +0100 [F] fixup! feat: Allow displaying the commit time of fixup candidates <_email_>
2) 217c498dc613058e0bb873c2b495f610be96cecf 2025-01-03 12:48:14 +0100 [F] WIP <_email_>
(git-fixup) ➜ git-fixup git:(add-sort-by-time) ✗ ./git-fixup -AStr
1) 217c498dc613058e0bb873c2b495f610be96cecf 2025-01-03 12:48:14 +0100 [F] WIP <_email_>
2) c64094fea2f3f4d7d2a62e9937469ef9b796313a 2025-01-03 12:36:27 +0100 [F] fixup! feat: Allow displaying the commit time of fixup candidates <_email_>I've also tested it out with I agree that the What do you think? Also, how could I add those to the |
|
That output looks good to me. I'm more inclined to do something like #58 to allow customisation of the output rather than a "show time" flag, lets just change the default to include time. Sure, the reverse flag makes some sense. The "cut time" operation I don't really see the need of git config is being loaded like this https://github.com/keis/git-fixup/blob/master/git-fixup#L169 Maybe something like |
I think this is a great idea. And in terms of custom output format, how about just taking whatever config is passed and passing it straight to On a related note: With displaying the time now, the output gets quite long - should we maybe also change the default to show the short hash instead of the full hash?
That was mainly because I'm concerned about backwards compatibility.
Thanks, I'll take a look at adding this, once we figured out what we want to add exactly.
Sounds like a good idea. |
|
The way I'm using this script is by the completion script and I actually do want the full input. The completion scripts work by showing the entire line by but only using the first word as the value. Making the config be git log format sounds good. the use of I like the idea of switching to short sha by default. But, yeah, lets keep the scope here to the sorting, make showing time and sorting the default. |
This is now the default - for discussion check keis#80.
This is mainly to reduce the overcrowding of the output due to the time being added in the previous commit.
7694e05 to
09e2111
Compare
|
Looks good to me! |




Proposed implementation of #79.
@keis let me know what you think 🙂