lambdalisue / vim-gita

[Obsolete] An awesome git handling plugin for Vim
Other
226 stars 8 forks source link

Display modified files before untracked files in `Gita status` buffer #108

Closed marcusbuffett closed 8 years ago

marcusbuffett commented 8 years ago

Would be a nice feature, most git programs put untracked last because they're least likely to be the files you care about.

lambdalisue commented 8 years ago

I'm sorry but that is not acceptable.

For example, assume the following situation

M  foobar/foobar.txt
 M foobar/hogehoge.txt

And assume that you hit -- on M foobar/hogehoge.txt to stage changes then:

M  foobar/foobar.txt
M  foobar/hogehoge.txt

And assume that you changed mind and hit -- on M foobar/hogehoge.txt again to unstage changes then:

M  foobar/foobar.txt
 M foobar/hogehoge.txt

Note that the order of the appearance has not changed during the situation. If gita sort files by its state, everytime when you stage/unstage changes, the order of appearance would change and users would lost which file they just stage/unstage if there are tons of changes.

This is one of the main reason I'm not comfortable with fugitive.vim. I need to be really careful to find which file I just stage/unstage.

marcusbuffett commented 8 years ago

What about the option to have flags like git status supports? Something like Gita status -uno would be very helpful and would avoid that situation you described.

lambdalisue commented 8 years ago

Hum... I'll think about it. Do you have any idea about the name of the option?

marcusbuffett commented 8 years ago

Yeah, the option is --untracked-files, or -u for short. You can set it to either no (no untracked files are shown), normal (self-explanatory), or all (which is what Gita status shows now). Would be awesome if Gita could support those options, thanks for the quick responses!

lambdalisue commented 8 years ago

Oops. Actually Gita status support -u/--untracked-files option but there is a bug. https://github.com/lambdalisue/vim-gita/commit/5cf7fd19517c562f1b82e102e3d4753b8f1475a8 fix that issue so you can disable untracked files by --untracked-files=no

:Gita status
" => Equal to Gita status --untracked-files=normal
:Gita status --untracked-files
" => Equal to Gita status --untracked-files=all
:Gita status --untracked-files=no
" => No untracked files will be shown

So is this what you want? I thought you were talking about the order of appearance of files in Gita status

marcusbuffett commented 8 years ago

You're absolutely right, I should have read the docs, sorry about that. Yeah originally I was talking about the order but your explanation for why that doesn't work makes a lot of sense, and the -u option solves the problem I was having. Thanks!