login
Header Space

 
 

Re: git filter-branch --subdirectory-filter

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: James Sadler <freshtonic@...>
Cc: Jeff King <peff@...>, <git@...>
Date: Friday, May 9, 2008 - 3:57 am

James Sadler schrieb:

It's expected to do B.


At this point you don't need subdirectory-filter. Use an --index-filter to
 keep only the subdirectory *and* remove the directory name at the same
time. Something like this:

git filter-branch --index-filter \
        'git ls-files -s thedir | sed "s-\tthedir/--" |
                GIT_INDEX_FILE=$GIT_INDEX_FILE.new \
                        git update-index --index-info &&
         mv $GIT_INDEX_FILE.new $GIT_INDEX_FILE' HEAD


The bit-for-bit correctness is not surprising, but the incorrect history
is. What is your definition of "correct" (i.e. can you give an example of
your expectations that are not met)? Do you have complicated history (with
merges)? Note that merges are removed if all but one of the merged
branches do not touch the subdirectory.

-- Hannes

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
git filter-branch --subdirectory-filter, James Sadler, (Thu May 8, 9:01 pm)
Re: git filter-branch --subdirectory-filter, Jeff King, (Thu May 8, 9:33 pm)
Re: git filter-branch --subdirectory-filter, James Sadler, (Fri May 9, 3:38 am)
Re: git filter-branch --subdirectory-filter, Jeff King, (Fri May 9, 4:00 am)
Re: git filter-branch --subdirectory-filter, James Sadler, (Fri May 9, 11:31 pm)
Re: git filter-branch --subdirectory-filter, Jeff King, (Sat May 10, 1:53 am)
Re: git filter-branch --subdirectory-filter, James Sadler, (Sat May 10, 7:38 am)
Re: git filter-branch --subdirectory-filter, Jeff King, (Sat May 10, 7:44 am)
Re: git filter-branch --subdirectory-filter, James Sadler, (Sat May 10, 3:10 am)
Re: git filter-branch --subdirectory-filter, Johannes Sixt, (Fri May 9, 3:57 am)
speck-geostationary