Hi guys,
I'm trying to tweak a little
When I type in git status on the commandline, I get a list of files that need to be resolved like so:
# Unmerged paths: #
# (use "git reset HEAD <file>..." to unstage)
# (use "git add <file>..." to mark resolution)
#
# both modified: apache2/templates/default/apache2.conf.erb
# both modified: bootstrap/attributes/default.rb
# both modified: iptables/metadata.rb
# both modified: kickstart/templates/default/ks.cfg.erb
# both modified: openssl/metadata.json
# both modified: postfix/metadata.json
# both modified: postfix/templates/default/main.cf.erb
Is there a simple way to pass this list of file paths into a text editor, so you can edit them all in one go?
I can get to this for example, by simply piping it through grep:
[17:37]:git status | grep "both modified"
# both modified: apache2/templates/default/apache2.conf.erb
# both modified: bootstrap/attributes/default.rb
# both modified: iptables/metadata.rb
# both modified: kickstart/templates/default/ks.cfg.erb
# both modified: openssl/metadata.json
# both modified: postfix/metadata.json
# both modified: postfix/templates/default/main.cf.erb
But I'm not sure how to return this using just shell commands, or whether it's simplest to drop into ruby or python, to pass each line through a regexp, to filter out the # both modified:
.
The end result I want is something like this:
vim #{space_separated_list_of_files}
How would you guys do this?