git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH v3 3/5] stash: simplify option parser for create

From
Ramkumar Ramachandra <artagnon@gmail.com>
Date
Jun 15, 2013, 13:13 UTC
Message-ID
<1371302006-29775-4-git-send-email-artagnon@gmail.com>
In-Reply-To
<1371302006-29775-1-git-send-email-artagnon@gmail.com>

The option parser for create unnecessarily checks "$1" inside a case statement that matches "$1" in the first place.

Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>
---
 git-stash.sh | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/git-stash.sh b/git-stash.sh
index bbefdf6..64800b8 100755
--- a/git-stash.sh
+++ b/git-stash.sh
@@ -546,10 +546,7 @@ clear)
 	clear_stash "$@"
 	;;
 create)
-	if test $# -gt 0 && test "$1" = create
-	then
-		shift
-	fi
+	shift
 	create_stash "$*" && echo "$w_commit"
 	;;
 drop)
-- 
1.8.3.1.441.gd7d6b72.dirty
Previous: Ramkumar RamachandraNext: Ramkumar Ramachandra
Message 4 of 10 in “Write a good 'stash store' for autostash”
  1. 0/5 Write a good 'stash store' for autostashRamkumar Ramachandra, Jun 15, 2013
  2. 1/5 stash doc: add a warning about using createRamkumar Ramachandra, Jun 15, 2013
  3. 2/5 stash doc: document short form -p in synopsisRamkumar Ramachandra, Jun 15, 2013
  4. 3/5 stash: simplify option parser for createRamkumar Ramachandra, Jun 15, 2013
  5. 4/5 stash: introduce 'git stash store'Ramkumar Ramachandra, Jun 15, 2013
  6. Junio C HamanoJun 17, 2013
  7. Ramkumar RamachandraJun 18, 2013
  8. Junio C HamanoJun 18, 2013
  9. 5/5 rebase: use 'git stash store' to simplify logicRamkumar Ramachandra, Jun 15, 2013
  10. Junio C HamanoJun 16, 2013

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.