Make (un)staging work on multiple files #421

Closed
mbunkus opened this Issue Jun 1, 2012 · 17 comments

Comments

Projects
None yet
Contributor

mbunkus commented Jun 1, 2012

Often enough retrieving the repo's status is rather slow (a couple of seconds). This happens with slower computers as well as with repos located on NFS volumes and a largish number of files (which is not uncommon: NFS is often used in companies, and "largish" is easily reached with any non-trivial project like OTRS which is around 12000 files).

Staging/unstaging multiple files (and hunks) with such projects is a major pain in the rear with magit as you cannot stage more than one file at a time. With hunks it's pretty much the same -- even though you can at least stage multiple lines in a hunk by selecting them.

Note that git adding multiple files from the command line is lightning fast even for situations show

I'd like to request a feature that somehow allows me to select multiple files and/or hunks, mark them, and stage/unstage them in one go refreshing the repo status only once at the end.

Would be nice to be able to use dired-style marking in magit buffers, to operate on a bunch of files at once, not just for staging but also for deleting multiple untracked files for example.

Contributor

monsanto commented Aug 25, 2012

+1 on this as well. (Github should have a starred issue thing like google code).

Another option is to allow setting the region on all of the objects you would like to stage. Not as flexible as dired style, but should be trivial to implement.

djg commented Oct 8, 2012

+1

feher commented Mar 5, 2013

+1
This feature is one that I miss a LOT. Without this, staging multiple, custom selected files (aka not all files) with magit is a major pain! It is dog slow updating after every single staged file.

vampolo commented May 23, 2013

+1

+1

xahlee commented Jul 8, 2013

didn't really want to add another me too, but didn't see such a button. Thanks for the great work on magit.

Owner

tarsius commented Oct 11, 2013

Please have a look at #992. It's pretty much the minimal viable version. I hope that works for you guys.

Owner

tarsius commented Oct 13, 2013

Merged #992.

@tarsius tarsius closed this Oct 13, 2013

I can't get #992 to work for adding multiple files; maybe I'm doing it wrong?

I use ctrl + space to highlight multiple un-added files and then try s to stage, but it only adds the first one.

ctor-x commented Feb 26, 2014

+1

Owner

tarsius commented Feb 26, 2014

How many files are in the region? When point is at the beginning of a line, then that file is no longer staged. So if the answer was two, then that is why.

When I have this (m indicates the mark, p point):

Unstaged changes (3):
m        Modified   magit-blame.el
         Modified   magit-wip.el
p        Modified   magit.el

Then both magit-blame.el and magit-wip.el are staged when I press s.

Possible make it work for deleting on files / stashes as well?

Owner

tarsius commented May 12, 2014

@yangchenyun I have added a note about this to #1167.

@tarsius I will follow up on that issue. Thank!

@tarsius tarsius removed the . label May 15, 2014

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