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

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

From
David Caldwell <david@porkrind.org>
Date
Jun 29, 2011, 17:11 UTC
Message-ID
<BE416D9D73FF59D8584480F7@black.porkrind.org>
On 6/26/11 1:02 PM -0700 Junio C Hamano wrote:
Show 5 quoted lines
> David Caldwell <david@porkrind.org> writes:
>
>>  create_stash () {
>>  	stash_msg="$1"
>> +	untracked="$2"
...
Show 13 quoted lines
>> -	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
Message 1 of 1 in “Re: [PATCH] stash: Add --include-untracked option to stash and remove all untracked files”
  1. David CaldwellJun 29, 2011

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.