bigH / git-fuzzy

interactive `git` with the help of `fzf`
MIT License
2.3k stars 42 forks source link

Add files from folder separately #47

Closed Andrei-Aksionov closed 2 years ago

Andrei-Aksionov commented 2 years ago

Hello

I enjoy using this tool but one thing annoys me (when I run git fuzzy status): if there is a new folder with files inside I am not able to:

  1. See what's inside this folder
  2. Add files separately

Here is a screenshot:

Screenshot 2022-04-08 at 5 17 31 PM

It would be awesome if this issue is fixed. Thanks.

bigH commented 2 years ago

This is a normal behavior of git. If you do git status --short, you'll see this. There's an --intent-to-add switch for git add that will display these files.

bigH commented 2 years ago

Additional info about --intent-to-add [0].

Generally, --intent-to-add seems like obscure functionality for special-cases. Though it solves your problem, it'd cause surprising outcomes for most users of git-fuzzy. I can think of 2 ways to implement this and both seem problematic:

  1. When adding, use --intent-to-add on directories. This is problematic because user will need to now manually add each file in the directory, rather than do it all at once, which was the original behavior.

  2. When displaying status, we could run git add --intent-to-add on any directories in status, then re-display status. Also problematic because if those files were not meant to be added, the user will need to address this directly.

This interface cannot completely replace git as there's a mountain of great functionality in git that simply has no need for a visual interface. For your situation I'd simply run git add --intent-to-add nvim and then git-fuzzy will show you the contents and allow you to decide what to do.

[0] https://stackoverflow.com/a/24347875