From: "James Sadler" <freshtonic@gmail.com>
To: "Jeff King" <peff@peff.net>
Cc: git@vger.kernel.org
Subject: Re: git filter-branch --subdirectory-filter
Date: Sat, 10 May 2008 13:31:37 +1000 [thread overview]
Message-ID: <e5e204700805092031m14c3d6c2kb85b51af5a1ee8f7@mail.gmail.com> (raw)
In-Reply-To: <20080509080039.GA15393@sigill.intra.peff.net>
2008/5/9 Jeff King <peff@peff.net>:
> On Fri, May 09, 2008 at 05:38:12PM +1000, James Sadler wrote:
>
>> I originally tried --subdirectory-filter by itself to see if it would
>> do the job, but it filtered more commits than I thought it should
>> (some commits that touched the subdir were missing after filter-branch
>> was run).
>>
>> I then began to question my understanding of the semantics of
>> subdirectory-filter.
>>
>> Is it meant to:
>> A) Only keep commits where ALL of the changes in the commit only touch
>> content under $DIR?
>> B) Only keep commits where SOME of the changes in the commit touch
>> content under $DIR?
>>
>> I suspected that it was behaving as A.
>
> My understanding is that it should behave as B. E.g.:
>
> git init
> mkdir subdir1 subdir2
> echo content 1 >subdir1/file
> echo content 2 >subdir2/file
> git add .
> git commit -m initial
> echo changes 1 >>subdir1/file
> git commit -a -m 'only one'
> echo more changes 1 >>subdir1/file
> echo more changes 2 >>subdir2/file
> git commit -a -m 'both'
> git filter-branch --subdirectory-filter subdir1
> git log --name-status --pretty=oneline
>
> should show something like:
>
> b119e21829b6039aa8fe938fb0304a9a7436b84d both
> M file
> db2ad8e702f36a1df99dd529aa594e756010b191 only one
> M file
> dacb4c2536e61c18079bcc73ea81fa0fb139c097 initial
> A file
>
Behaving as B is definitely the desired behaviour, but I am not observing that.
I'll see if I can create a test case to demonstrate. Unfortunately,
I don't have the right to distribute our repo so will have to attempt
to reproduce the
problem another way.
Does anybody have a script that can take an existing repo,
and create a new one with garbled-but-equivalent commits? i.e. file
and directory structure
is same with names changed, and there is a one-one relationship
between lines of text
in new repo and old one except the lines have been scrambled? It would be
a useful tool for distributing private repositories for debugging reasons.
> IOW, all commits touch subdir1/file, which becomes just 'file'.
>
> It could be a bug in git-filter-branch. What version of git are you
> using?
I am using git version 1.5.5
>
> -Peff
>
--
James
next prev parent reply other threads:[~2008-05-10 3:32 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-05-09 1:01 git filter-branch --subdirectory-filter James Sadler
2008-05-09 1:33 ` Jeff King
2008-05-09 7:38 ` James Sadler
2008-05-09 7:57 ` Johannes Sixt
2008-05-09 8:00 ` Jeff King
2008-05-10 3:31 ` James Sadler [this message]
2008-05-10 5:53 ` Jeff King
2008-05-10 7:10 ` James Sadler
2008-05-10 11:38 ` James Sadler
2008-05-10 11:44 ` Jeff King
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=e5e204700805092031m14c3d6c2kb85b51af5a1ee8f7@mail.gmail.com \
--to=freshtonic@gmail.com \
--cc=git@vger.kernel.org \
--cc=peff@peff.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).