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

[PATCH] squash! diff: add --diff-line-prefix option for passing in a prefix

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Aug 14, 2016, 08:56 UTC
Message-ID
<5ca415f99718b1792cd0a9c31606b45d27befc48.1471164824.git.johannes.schindelin@gmx.de>

The '>' character is not a legal part of filenames on Windows. So let's just not use it in Git's source code. This poses a challenge in the test script t4013 which distills command-lines into file names (so that the expected outcome can be stored in files with said names).

We have to take particular care not to confound the existing conversion of unwanted characters to underscores with the new substitution of '>': the existing conversion chose to collapse runs of multiple unwanted characters into a single underscore. If we allowed '>' to be collapsed, too, the file name generated from the command "diff [...]=-- [...]" would be identical to the one generated from "diff [...]=--> [...]".

Please squash this patch into 3c90ffd2f01e2d0d080c8e42df2ee89709b324de

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
---
Published-As: https://github.com/dscho/git/releases/tag/mingw-t4013-v1
Fetch-It-Via: git fetch https://github.com/dscho/git mingw-t4013-v1
	For the record: this prevented my beautiful CI jobs from even
	checking out the source code for `pu` in the last days.
	Junio, please let me know if you would prefer this as a separate
	patch.
 t/t4013-diff-various.sh                                                 | 2 +-
 ...aster^_side => diff.diff_--diff-line-prefix=--__master_master^_side} | 0
 2 files changed, 1 insertion(+), 1 deletion(-)
 rename t/t4013/{diff.diff_--diff-line-prefix=-->_master_master^_side => diff.diff_--diff-line-prefix=--__master_master^_side} (100%)
diff --git a/t/t4013-diff-various.sh b/t/t4013-diff-various.sh
index 5204645..84e2ee0 100755
--- a/t/t4013-diff-various.sh
+++ b/t/t4013-diff-various.sh
@@ -115,7 +115,7 @@ do
 	case "$cmd" in
 	'' | '#'*) continue ;;
 	esac
-	test=$(echo "$cmd" | sed -e 's|[/ ][/ ]*|_|g')
+	test=$(echo "$cmd" | sed -e 's|[/ ][/ ]*|_|g' -e 'y/>/_/')
 	pfx=$(printf "%04d" $test_count)
 	expect="$TEST_DIRECTORY/t4013/diff.$test"
 	actual="$pfx-diff.$test"
diff --git a/t/t4013/diff.diff_--diff-line-prefix=-->_master_master^_side b/t/t4013/diff.diff_--diff-line-prefix=--__master_master^_side
similarity index 100%
rename from t/t4013/diff.diff_--diff-line-prefix=-->_master_master^_side
rename to t/t4013/diff.diff_--diff-line-prefix=--__master_master^_side
-- 
2.9.2.691.g78954f3

base-commit: 945e149951a152207b56d5e49ff5167d151a4c89
Next: Junio C Hamano
Message 1 of 5 in “squash! diff: add --diff-line-prefix option for passing in a prefix”
  1. squash! diff: add --diff-line-prefix option for passing in a prefixJohannes Schindelin, Aug 14, 2016
  2. Junio C HamanoAug 14, 2016
  3. Johannes SchindelinAug 15, 2016
  4. Junio C HamanoAug 15, 2016
  5. Johannes SchindelinAug 16, 2016

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.