Re: [BUG] `git stash drop --help` removes stash

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Alexander Daniel <alexander.daniel@xxxxxxxxxxxxx> writes:

> SUMMARY
> `git stash drop --help` removes stash@{0}

Thanks.

Unfortunately there is no subcommand specific help text, so a quick fix
would be along the lines of the attached patch.

The right fix would be to instead add support for subcommand specific help
text.  Such a change would tweak assert_stash_like and assert_stash_ref
not to die when --help is given even if there is no stash (or an explicit
command line argument did not name a stash), and then make all subcommand
implementations in the script (e.g. find places where these two functions
are called) notice that the user asked for --help and give subcommand
specific help text from there.


 git-stash.sh | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/git-stash.sh b/git-stash.sh
index 4e2c7f8..487e2b5 100755
--- a/git-stash.sh
+++ b/git-stash.sh
@@ -339,6 +339,9 @@ parse_flags_and_rev()
 			--index)
 				INDEX_OPTION=--index
 			;;
+			--help)
+				usage
+			;;
 			-*)
 				FLAGS="${FLAGS}${FLAGS:+ }$opt"
 			;;
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]