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

Re: [PATCH] Add more tests for git-clean

From
Junio C Hamano <gitster@pobox.com>
Date
Nov 5, 2007, 00:17 UTC
Message-ID
<7vr6j5r1ec.fsf@gitster.siamese.dyndns.org>
In-Reply-To
<20071104234617.GG4207@artemis.corp>
Pierre Habouzit <madcoder@debian.org> writes:
Show 16 quoted lines
> On Sun, Nov 04, 2007 at 11:35:42PM +0000, Junio C Hamano wrote:
>> Shawn Bohrer <shawn.bohrer@gmail.com> writes:
>> 
>> > +test_expect_success 'git-clean with prefix' '
>> > +
>> > +	mkdir -p build docs &&
>> > +	touch a.out src/part3.c docs/manual.txt obj.o build/lib.so &&
>> > +	cd src/ &&
>> > +	git-clean &&
>> > +	cd - &&
>> 
>> This is wrong for two reasons.
>> 
>>  - Is "cd -" portable?
>
>   this is POSIX:

That actually doesn't matter. What the real world shells do matters more.

In addition, "cd -" is a nice shorthand for interactive use but it is a bad discipline to use it in a script anyway.

	...
	( cd src && git-clean ) &&
	...
would be the best way to write this.
Previous: Pierre HabouzitNext: Johannes Schindelin
Message 14 of 15 in “[RFC] Second attempt at making git-clean a builtin”
  1. Shawn BohrerNov 4, 2007
  2. Add more tests for git-cleanShawn Bohrer, Nov 4, 2007
  3. Make git-clean a builtinShawn Bohrer, Nov 4, 2007
  4. Pierre HabouzitNov 4, 2007
  5. 3/2 Use parse-options in builtin-cleanJohannes Schindelin, Nov 4, 2007
  6. Pierre HabouzitNov 4, 2007
  7. Junio C HamanoNov 5, 2007
  8. Carlos RicaNov 5, 2007
  9. Junio C HamanoNov 5, 2007
  10. Shawn BohrerNov 6, 2007
  11. Junio C HamanoNov 6, 2007
  12. Junio C HamanoNov 4, 2007
  13. Pierre HabouzitNov 4, 2007
  14. Junio C HamanoNov 5, 2007
  15. Johannes SchindelinNov 4, 2007

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.