Re: [PATCH] stash: Add --include-untracked option to stash and remove all untracked files

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

 



On 6/26/11 1:02 PM -0700 Junio C Hamano wrote:

David Caldwell <david@xxxxxxxxxxxx> writes:

 create_stash () {
 	stash_msg="$1"
+	untracked="$2"
...
-	create_stash "$stash_msg"
+	create_stash "$stash_msg" $untracked

Just a minor nit from internal API point of view, I would prefer to see
something like

	create_stash --untracked=all "message"

or even

	create_stash --untracked=all --message="message"

once you start enriching these functions with optional behaviour.

I could do that, but doesn't that mean create_stash() would have to have a whole while loop and case statement just to parse the two options? Because that seems a little overkill for something that is only called from 2 places. Is there some nice compact way of doing the parsing I'm missing?

I could also remove parameter passing part and just leave it as a global like the --patch option does. ;-)

-David

Attachment: pgpUNNv90Ottp.pgp
Description: PGP signature


[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]