Skip to contentSkip to conversation

Fix typo in filter-branch example

PATCH In review Ori Avtalion 3 participants 4 messages Jun 15, 2016 Documentation

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Fix typo in filter-branch example

---
 Documentation/git-filter-branch.txt |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
Documentation/git-filter-branch.txt +1 -1
index ab527b5..8cda87c 100644
@@ -336,7 +336,7 @@ To move the whole tree into a subdirectory, or remove it from there:
 
 ---------------------------------------------------------------
 git filter-branch --index-filter \
-	'git ls-files -s | sed "s-\t-&newsubdir/-" |
+	'git ls-files -s | sed "s-\t-\tnewsubdir/-" |
 		GIT_INDEX_FILE=$GIT_INDEX_FILE.new \
 			git update-index --index-info &&
 	 mv $GIT_INDEX_FILE.new $GIT_INDEX_FILE' HEAD
Signature · 1 line
1.6.4.114.gefd1.dirty
#1 lore raw

Ori Avtalion venit, vidit, dixit 13.08.2009 18:16:

Quoted 9 lines
---
 Documentation/git-filter-branch.txt |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
Documentation/git-filter-branch.txt +0 -0
index ab527b5..8cda87c 100644

Documentation/git-filter-branch.txt To move the whole tree into a subdirectory, or remove it from there: · line 342

Quoted 8 lines
Documentation/git-filter-branch.txt +1 -1
@@ -336,7 +336,7 @@ To move the whole tree into a subdirectory, or remove it from there:
 
 ---------------------------------------------------------------
 git filter-branch --index-filter \
-	'git ls-files -s | sed "s-\t-&newsubdir/-" |
+	'git ls-files -s | sed "s-\t-\tnewsubdir/-" |
 		GIT_INDEX_FILE=$GIT_INDEX_FILE.new \
 			git update-index --index-info &&
 	 mv $GIT_INDEX_FILE.new $GIT_INDEX_FILE' HEAD

If \t is matched then isn't & == \t?

Michael

#2 lore raw
In reply to Ori Avtalion

Hi,

Quoted 1 line · Ori Avtalion

---

This is not a typo. '&' is sed's way to specify the matched string. Where does it occur anyway (the commit message makes a fabulous place to put such information)?

Ciao,
Dscho

#3 lore raw
Quoted 4 lines · Johannes Schindelin

This is not a typo. '&' is sed's way to specify the matched string. Where does it occur anyway (the commit message makes a fabulous place to put such information)?

Whoops! My mistake!

I think I accidentally removed it when I tried the example, and then added it in a wrong position when that didn't work :)

Sorry for the false alarm!