From: Konstantin Khomoutov <kostix+git@007spb.ru>
To: shawn wilson <ag4ve.us@gmail.com>
Cc: Git List <git@vger.kernel.org>
Subject: Re: split directories into branches
Date: Mon, 4 Jul 2016 20:39:46 +0300 [thread overview]
Message-ID: <20160704203946.3ac8d3205c08bfaee9a93a46@domain007.com> (raw)
In-Reply-To: <CAH_OBieCcx0_=vuZgoJ8GrZhhReEAhnjrz2pQwbwGgPFww4JmQ@mail.gmail.com>
On Mon, 4 Jul 2016 12:45:39 -0400
shawn wilson <ag4ve.us@gmail.com> wrote:
> I've got a chef cookbook repo where everyone started developing
> cookbooks in a single dev branch (not project specific). Minus a few
> edge cases, it should be fairly simple to split this up into feature
> branches based on /cookbooks/<feature>.
>
> I tried:
> $ git filter-branch --subdirectory-filter cookbooks/<feature>--
> <feature> And
> $ git subtree split --prefix cookbooks/<feature> -b <feature>
>
> Which both seem to do the same thing (haven't looked at the subtree
> bash - guessing it does exactly the filter-branch). The issue is that
> it removes the directory tree (so obviously merges wouldn't work). I'm
> thinking some type of filter-branch --index-filter with a cherry pick
> (or similar) should work...?
To achieve what you're after I used `git subtree split` followed by
`git filter-branch --tree-filter ...` which moved all the files under
the directory hierarchy `git subtree split` removes.
I'd love if `git subtree split` had an option to preserve the prefix
(even better would be to have another option to rewrite the prefix)
because that would greatly simplify another use case for `git subtree`:
moving "a directory" with its full history from one repository into
another. Presently, the user is able to split that directory out from
the source repository but when they subtree-merge it back in the new
repository, they are puzzled by the fact `git log` invoked on the new
history with the pathname prefix designating the "inserted" directory
does not traverse past the merge point which brought that directory in.
I know Git tracks content, not files (and directory) but still many
folks have "stable" directories for their files, assign certain
semantics to them etc. I've needed such transfers myself, and this
topic has been raised more than once by folks over there on the
git-users mailing list.
next prev parent reply other threads:[~2016-07-04 17:39 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-07-04 16:45 split directories into branches shawn wilson
2016-07-04 17:39 ` Konstantin Khomoutov [this message]
2016-07-04 18:15 ` shawn wilson
2016-07-04 18:29 ` Konstantin Khomoutov
2016-07-04 21:03 ` shawn wilson
2016-07-04 22:10 ` Andreas Schwab
2016-07-04 23:30 ` shawn wilson
2016-07-04 23:31 ` shawn wilson
2016-07-05 9:56 ` Konstantin Khomoutov
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=20160704203946.3ac8d3205c08bfaee9a93a46@domain007.com \
--to=kostix+git@007spb.ru \
--cc=ag4ve.us@gmail.com \
--cc=git@vger.kernel.org \
/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).