Comments (2)
Oh that could be super useful!
I propose --sort git
as the option flag.
Design Thoughts
Matching the order of git status
output is probably the most intuitive.
git status
prints file names with staged changes first, then file names with unstaged changes, and then finally untracked names (and within those groups, the sort is alphabetical/lexical).
exa
has to adapt that a bit because it only has one entry per path (a file with both staged and unstanged changes only gets one entry, whereas in git status
it gets listed twice) and because it might also be listing files that are in .gitignore
. But I think the closer we get to an intuitive match between the two the better.
So I propose to sort by like this:
- paths with staged changes go before paths without staged changes,
- within that, paths with unstaged changes get sorted before paths without unstaged changes, and
- within that, new status
N
gets sorted beforeM
(this last thing deviates fromgit status
but I think it would make a big difference in certain situations, because then you reduce the frequency and unpredictability of where you need to noticeN
vsM
distinctions in the listing... also in practice for it has been true for years that I occasionally find myself wishing thatgit status
grouped by renamed/added/deleted/modified within staged/unstaged/untracked before the lexical sort).
Sorting staged-changes before no-staged-changes also matches a decision already made in --git
output: staged status is the left character, unstaged status is the right character. So when you scan visually, it would work out really nicely - for example (modified from Exa --git
documentation):
$ exa --long --git
Permissions Size User Date Modified Git Name
.rw-r--r-- 155 ben 25 Nov 17:23 NM unselectable.scss
.rw-r--r-- 612 ben 24 Nov 16:04 M- media.scss
.rw-r--r-- 260 ben 25 Nov 17:23 -M icon.scss
.rw-r--r-- 59 ben 25 Nov 17:23 -N plain-link.scss
.rw-r--r-- 96 ben 21 Nov 14:20 -- hoverable.scss
Which corresponds to:
$ git status
Your branch is up to date with 'origin/main'.
Changes to be committed:
(use "git restore --staged <file>..." to unstage)
modified: media.scss
new file: unselectable.scss
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git restore <file>..." to discard changes in working directory)
modified: icon.scss
modified: unselectable.scss
Untracked files:
(use "git add <file>..." to include in what will be committed)
plain-link.scss
P.S. a third reason for making has-staged-changes versus does-not-have-staged-changes as the primary sort is that right before a commit, the most important/salient difference is what's staged - and any deliberate use of the staging area (staging smaller pieces for individual commits instead of basically ignoring the staged/unstaged difference and committing all outstanging changes at once), it's really helpful to have a fast-and-easy-to-visually-parse cue of staged-vs-unstaged.
from exa.
Sounds excellent to me.
from exa.
Related Issues (20)
- --git does nothing if git config file has a multi-line value HOT 6
- βicons
- Cargo unable to build released version of Exa from cargo registry HOT 1
- Can I make the output color look like `ls`? HOT 8
- Use font dimming to communicate modification/creation time
- Missing library libgit2.so.1.6 after Arch update HOT 4
- Expose gitignore status to custom colorization via EXA_COLORS
- Would you be interested in having a Dockerfile for development? HOT 4
- `GIT_CEILING_DIRECTORIES` is not respected HOT 5
- exa: Unknown argument -A HOT 10
- Allow Directory Permissions to use Different Color Values than File Permissions
- Library not loaded HOT 1
- Order of the columns HOT 1
- A way to not display the `@` (at sign) for files with extended attributes HOT 8
- Support `-z` for null-separated output
- Please remove special bin icon association HOT 1
- exa is unmaintained, please use the active fork eza instead HOT 17
- Sorry, my kid randomly touched the keyboard HOT 3
- So, this issue should probably be transferred to eza HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from exa.