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

Re: [PATCH 2/2] Improve "move the whole tree into a subdirectory" example.

From
Junio C Hamano <gitster@pobox.com>
Date
Jul 21, 2010, 05:28 UTC
Message-ID
<7vk4opjtdo.fsf@alter.siamese.dyndns.org>
In-Reply-To
<1279574238-16649-2-git-send-email-ville.skytta@iki.fi>
Ville Skyttä <ville.skytta@iki.fi> writes:
> Using "/" as the sed substitution delimiter is less likely to clash
> with desired subdirectory names than "-".
Sign-off?

The standard substitution in a case like this where you want to avoid using "/" is "|", not "-".

Show 25 quoted lines
> ---
>  Documentation/git-filter-branch.txt |    5 +++--
>  1 files changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/Documentation/git-filter-branch.txt b/Documentation/git-filter-branch.txt
> index 020028c..a90e2dd 100644
> --- a/Documentation/git-filter-branch.txt
> +++ b/Documentation/git-filter-branch.txt
> @@ -354,11 +354,12 @@ git filter-branch ... C..H --not D
>  git filter-branch ... D..H --not C
>  ----------------------------------------
>  
> -To move the whole tree into a subdirectory, or remove it from there:
> +To move the whole tree into a subdirectory named newsubdir, 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\"*/&newsubdir\//" |
>  		GIT_INDEX_FILE=$GIT_INDEX_FILE.new \
>  			git update-index --index-info &&
>  	 mv $GIT_INDEX_FILE.new $GIT_INDEX_FILE' HEAD
> -- 
> 1.7.1.1
Previous: Ville SkyttäNext: Ville Skyttä
Message 3 of 6 in “Documentation spelling fixes.”
  1. 1/2 Documentation spelling fixes.Ville Skyttä, Jul 19, 2010
  2. 2/2 Improve "move the whole tree into a subdirectory" example.Ville Skyttä, Jul 19, 2010
  3. Junio C HamanoJul 21, 2010
  4. Improve "move the whole tree into a subdirectory" example.Ville Skyttä, Jul 21, 2010
  5. Jonathan NiederJul 19, 2010
  6. Ville SkyttäJul 20, 2010

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.