Skip to content
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

Support for "git add -A" #114

Open
wleese opened this issue Jan 27, 2017 · 11 comments
Open

Support for "git add -A" #114

wleese opened this issue Jan 27, 2017 · 11 comments

Comments

@wleese
Copy link

wleese commented Jan 27, 2017

Basically I'd like a way to stage everything by default, either through an option or key mapping.

@jreybert
Copy link
Owner

That's something I am thinking since a while. I wonder what might be the default behavior and mapping.

@wleese
Copy link
Author

wleese commented Jan 27, 2017

I believe most people dislike this behavior. So I'd suggest:

  • An option to add all by default. Default value: disabled
  • AA as a mapping that toggles between "add all" and "remove all"

@jreybert
Copy link
Owner

jreybert commented Jan 27, 2017

What do you mean by "An option to add all by default"? With which mapping?
AA is a good mapping, if it is added it should be always enabled.
I must look in fugitive if there is already a mapping for this.

@wleese
Copy link
Author

wleese commented Jan 27, 2017

What do you mean by "An option to add all by default"? With which mapping?

Maybe my use of words isn't correct VIM terminology, sorry :)
From a user standpoint: when I :Magit add all files to Staged if in my .vimrc I have:
let g:magit_always_stage_all = true (for example).

But any of the 2 features (or both :)) is good for me.

@jreybert
Copy link
Owner

jreybert commented Jan 27, 2017

From a user standpoint: when I :Magit add all files to Staged if in my .vimrc I have:

Just to be sure: you want that all files to be staged when you open magit buffer with :Magit?
In that case, no, it won't be added like that. Good news is that you can already to that.

autocmd User VimagitBufferInit call system(g:magit_git_cmd . " add -A " . magit#git#top_dir())

About the mapping, IMO there are two main behaviors here:

  1. stage all modified files
  2. stage all modified + untracked files
    Mappings could be:
  3. aa
  4. aA

@wleese
Copy link
Author

wleese commented Jan 27, 2017

Good point about the untracked files.
Thanks and looking forward to /any/ implementation :)

@jreybert
Copy link
Owner

You can already add the autocmd User VimagitBufferInit trick in your vimrc, it will do the job.

@wleese
Copy link
Author

wleese commented Jan 27, 2017

Done, thanks again

@fpnick
Copy link

fpnick commented Jan 27, 2017

Great idea. For my personal workflow it would also be convenient if aa/aA would automatically trigger CC.

@jreybert
Copy link
Owner

jreybert commented Jan 27, 2017

@fpnick hm, I'll see how to do that... I am not fan to add another autocmd User or a g:magit_aa_auto_commit just for that (vimagit already have too many options!). I'll think how it could be added. IMO, type aA CC is natural, auto CC would not be a great benefit.

@fpnick
Copy link

fpnick commented Jan 27, 2017

Sure, it's a matter of taste... It's not crucial of course.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants