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

Re: Filter-branch's "move tree to subdirectory" example fails with BSD sed?

From
Johannes Sixt <j6t@kdbg.org>
Date
Apr 14, 2012, 19:25 UTC
Message-ID
<4F89CF11.7060309@kdbg.org>
In-Reply-To
<20120414160028.GD1012@gmail.com>
Am 14.04.2012 18:00, schrieb Christopher Tiwald:
> The "Move tree to subdirectory" example in the 'git filter-branch'
> manpage fails on Mac OSX 10.7.3, but succeeds on Ubuntu 10.04.
Show 13 quoted lines
> git init "test"
> cd "test"
> mkdir -p subdirA/subdirB
> echo content > subdirA/subdirB/file
> git add .
> git commit -m "initial commit"
> git ls-files -s | sed "s-\t\"*-&newsubdir/-"
> 
> On Mac 10.7.3 the final command outputs:
> 100644 d95f3ad14dee633a758d2e331151e950dd13e4ed 0	subdirA/subdirB/file
> 
> On Ubuntu 10.04:
> 100644 d95f3ad14dee633a758d2e331151e950dd13e4ed 0	newsubdir/subdirA/subdirB/file
Perhaps a literal TAB instead of \t makes the example work?

It would be difficult, though, to write this down in the manual in an unambiguous way.

-- Hannes
Previous: Christopher TiwaldNext: Jeff King
Message 2 of 9 in “Filter-branch's "move tree to subdirectory" example fails with BSD sed?”
  1. Christopher TiwaldApr 14, 2012
  2. Johannes SixtApr 14, 2012
  3. Jeff KingApr 16, 2012
  4. 1/2 update-index: add --clear optionJeff King, Apr 16, 2012
  5. Christopher TiwaldApr 16, 2012
  6. Christopher TiwaldApr 17, 2012
  7. 2/2 docs/filter-branch: clean up newsubdir exampleJeff King, Apr 16, 2012
  8. Junio C HamanoApr 16, 2012
  9. Jeff KingApr 16, 2012

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.