gitステータス出力を変更して、各パスを他のコマンドを実行するために使用できる変数として扱うにはどうすればよいですか?gitステータス出力に変数を追加する
例:ファイルや長いファイルパスの多くを扱うとき
$ git status
# On branch master
#
# Changes not staged for commit:
# (use "git add <file>..." to update what will be committed)
# (use "git checkout -- <file>..." to discard changes in working directory)
#
# {1} modified: path/to/some/file.txt
# {2} modified: path/to/some/other/file.txt
# {3} modified: some/really/long/path/to/some/file.txt
$ git add {2}
$ git status
# On branch master
#
# Changes to be committed:
# (use "git reset HEAD <file>..." to unstage)
#
# modified: path/to/some/other/file.txt
#
# Changes not staged for commit:
# (use "git add <file>..." to update what will be committed)
# (use "git checkout -- <file>..." to discard changes in working directory)
#
# {1} modified: path/to/some/file.txt
# {2} modified: some/really/long/path/to/some/file.txt
これは便利かもしれません。私はそれが非常にトリッキーな(または不可能)と思う? git add
man pageから更新モードとgit add --interactive
のように見えます
私はこの作業を見る方法を実行する、すべての変数をキャッシュすることですファイルの変更が検出された場合は、キャッシュをクリアします。ユーザーが古くなった(キャッシュされていない)変数を使用しようとすると、変数を 'リフレッシュ'するために再びステータスをgitするように促します。これにより、古い変数の操作を停止します。 – Luke