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

Re: [PATCH 2/2] diff: generate prettier filenames when using GIT_EXTERNAL_DIFF

From
David Aguilar <davvid@gmail.com>
Date
May 27, 2009, 05:17 UTC
Message-ID
<20090527051737.GA2986@gmail.com>
In-Reply-To
<1243394364-13772-2-git-send-email-davvid@gmail.com>
On Tue, May 26, 2009 at 08:19:24PM -0700, David Aguilar wrote:
Show 5 quoted lines
> --- a/t/t4020-diff-external.sh
> +++ b/t/t4020-diff-external.sh
> @@ -136,6 +136,24 @@ test_expect_success 'GIT_EXTERNAL_DIFF with more than one changed files' '
>  	GIT_EXTERNAL_DIFF=echo git diff
>  '

Sorry for including both tests here. I forgot to remove the first test when we changed the naming convention to 6X_name and not special-casing filenames with dots in them.

I guess I'll resend w/out it. I'll wait until wednesday evening before resending to see if anyone spots any other fixups.

The rationale for the original naming convention was that it was arguably easier for users to spot what file they're working on when playing games with dot.

compare:
a) !!!!!!_Makefile
b) Makefile_!!!!!!
and:
a) !!!!!!_diff.c
b) diff.!!!!!!.c

In both examples you already know what filename you're talking about before scanning past any other information.

.gitignore would look like .!!!!!!.gitignore, which isn't too bad either.

Anyways, not looking to bikeshed, so I'll wait to here what others have to say and continue. The patch is fine as-is too sans the first test.

Show 24 quoted lines
> +test_expect_success 'GIT_EXTERNAL_DIFF generates pretty paths with no ext' '
> +	touch filenoext &&
> +	git add filenoext &&
> +	echo no extension > filenoext &&
> +	GIT_EXTERNAL_DIFF=echo git diff filenoext | grep _filenoext &&
> +	git update-index --force-remove filenoext &&
> +	rm filenoext
> +'
> +
> +test_expect_success 'GIT_EXTERNAL_DIFF generates pretty paths with ext' '
> +	touch file.ext &&
> +	git add file.ext &&
> +	echo with extension > file.ext &&
> +	GIT_EXTERNAL_DIFF=echo git diff file.ext | grep ......_file\.ext &&
> +	git update-index --force-remove file.ext &&
> +	rm file.ext
> +'
> +
>  echo "#!$SHELL_PATH" >fake-diff.sh
>  cat >> fake-diff.sh <<\EOF
>  cat $2 >> crlfed.txt
> -- 
> 1.6.3.1.169.g33fd
> 
-- 
	David
Previous: David AguilarNext: Johannes Sixt
Message 3 of 8 in “compat: add a mkstemps() compatibility function”
  1. 1/2 compat: add a mkstemps() compatibility functionDavid Aguilar, May 27, 2009
  2. 2/2 diff: generate prettier filenames when using GIT_EXTERNAL_DIFFDavid Aguilar, May 27, 2009
  3. David AguilarMay 27, 2009
  4. Johannes SixtMay 27, 2009
  5. David AguilarMay 27, 2009
  6. David AguilarMay 27, 2009
  7. Johannes SixtMay 27, 2009
  8. Jakub NarebskiMay 27, 2009

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.