{"thread":{"id":"35933","subject":"[PATCH] rm: Accept --staged as a synonym of --cached","startedAt":"2014-02-22T05:30:09Z","lastAt":"2014-02-22T05:30:09Z","messageCount":1,"participants":["Ryan Schmitt"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"235164","messageId":"1393047009-30168-1-git-send-email-rschmitt@pobox.com","threadId":"35933","inReplyTo":null,"subject":"[PATCH] rm: Accept --staged as a synonym of --cached","fromName":"Ryan Schmitt","fromEmail":"rschmitt@pobox.com","sentAt":"2014-02-22T05:30:09Z","receivedAt":"2014-02-22T05:30:09Z","isPatch":true,"sender":{"key":"rschmitt@pobox.com","avatar":null},"body":"From: Ryan Schmitt <rschmitt@u.rochester.edu>\n\nThis makes git-rm more consistent with git-diff, which also accepts\n--staged as a synonym of --cached.\n\nSigned-off-by: Ryan Schmitt <rschmitt@pobox.com>\n---\n Documentation/git-rm.txt | 2 +-\n builtin/rm.c             | 1 +\n t/t3600-rm.sh            | 6 ++++++\n 3 files changed, 8 insertions(+), 1 deletion(-)\n\ndiff --git Documentation/git-rm.txt Documentation/git-rm.txt\nindex f1efc11..8635e67 100644\n--- Documentation/git-rm.txt\n+++ Documentation/git-rm.txt\n@@ -58,7 +58,7 @@ OPTIONS\n --cached::\n \tUse this option to unstage and remove paths only from the index.\n \tWorking tree files, whether modified or not, will be\n-\tleft alone.\n+\tleft alone. --staged is a synonym for --cached.\n \n --ignore-unmatch::\n \tExit with a zero status even if no files matched.\ndiff --git builtin/rm.c builtin/rm.c\nindex 960634d..a88697b 100644\n--- builtin/rm.c\n+++ builtin/rm.c\n@@ -269,6 +269,7 @@ static struct option builtin_rm_options[] = {\n \tOPT__DRY_RUN(&show_only, N_(\"dry run\")),\n \tOPT__QUIET(&quiet, N_(\"do not list removed files\")),\n \tOPT_BOOL( 0 , \"cached\",         &index_only, N_(\"only remove from the index\")),\n+\tOPT_BOOL( 0 , \"staged\",         &index_only, N_(\"synonym for --cached\")),\n \tOPT__FORCE(&force, N_(\"override the up-to-date check\")),\n \tOPT_BOOL('r', NULL,             &recursive,  N_(\"allow recursive removal\")),\n \tOPT_BOOL( 0 , \"ignore-unmatch\", &ignore_unmatch,\ndiff --git t/t3600-rm.sh t/t3600-rm.sh\nindex 3d30581..c32dbf4 100755\n--- t/t3600-rm.sh\n+++ t/t3600-rm.sh\n@@ -72,6 +72,12 @@ test_expect_success \\\n      git rm --cached -f foo'\n \n test_expect_success \\\n+    'Test that git rm --staged foo is synonymous with git rm --cached foo' \\\n+    'echo content > foo\n+     git add foo\n+     git rm --staged foo'\n+\n+test_expect_success \\\n     'Post-check that foo exists but is not in index after git rm foo' \\\n     '[ -f foo ] && test_must_fail git ls-files --error-unmatch foo'\n \n-- \n1.8.3.2\n"}]}