{"thread":{"id":"21106","subject":"Trying to split repository","startedAt":"2009-10-01T16:03:35Z","lastAt":"2009-10-02T15:42:04Z","messageCount":9,"participants":["Josef Wolf","Adam Brewster","Tomas Carnecky","Jeff King"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"124088","messageId":"20091001160335.GA26068@raven.wolf.lan","threadId":"21106","inReplyTo":null,"subject":"Trying to split repository","fromName":"Josef Wolf","fromEmail":"jw@raven.inka.de","sentAt":"2009-10-01T16:03:35Z","receivedAt":"2009-10-01T16:03:35Z","isPatch":false,"sender":{"key":"jw@raven.inka.de","avatar":null},"body":"Hello,\n\nOne of my repositories has grown a subdirectory that I'd like to split off,\nso other can use it as a subproject. With the help of google, I found this\nsolution:\n\n    # first extract the library from the original repository\n    #\n    git clone --no-hardlinks repository library.tmp\n    (\n        cd library.tmp\n        git filter-branch --subdirectory-filter CF -- --all\n        git reset --hard\n        git gc --aggressive\n        git prune\n        git gc\n        git clone --bare . ../library\n    )\n    rm -rf library.tmp\n\n\n    # Now remove the library from the original repository, so it can be\n    # included as a subproject\n    #\n    git clone --no-hardlinks repository repository.new.tmp\n    (\n        cd repository.new.tmp\n        git filter-branch \\\n            --index-filter \"git rm -r -f --cached --ignore-unmatch CF\" \\\n            -- --all\n        git reset --hard\n        git gc --aggressive\n        git prune\n        git gc\n        git clone --bare . ../repository.new\n    )\n    rm -rf repository.new.tmp\n\nThis works fine. But there's one problem, though. \"gitk --all\" in the new\nrepository still shows all the history of the removed library. The patch\nshow no modifications, but the log entry is still there.\n\nAny hints how to get rid of those log entries?\n"},{"id":"124089","messageId":"c376da900910010949p197aa311l9c91ef711beffdf7@mail.gmail.com","threadId":"21106","inReplyTo":"20091001160335.GA26068@raven.wolf.lan","subject":"Re: Trying to split repository","fromName":"Adam Brewster","fromEmail":"adambrewster@gmail.com","sentAt":"2009-10-01T16:49:03Z","receivedAt":"2009-10-01T16:49:03Z","isPatch":false,"sender":{"key":"adambrewster@gmail.com","avatar":"https://avatars.githubusercontent.com/u/223816?v=4"},"body":">\n> Any hints how to get rid of those log entries?\n\ngit-filter-branch accepts a --prune-empty option that does what I\nthink you're looking for.\n\nAdam\n"},{"id":"124090","messageId":"427FD5A1-A416-424C-9F6F-35AE9E6F9E9B@dbservice.com","threadId":"21106","inReplyTo":"20091001160335.GA26068@raven.wolf.lan","subject":"Re: Trying to split repository","fromName":"Tomas Carnecky","fromEmail":"tom@dbservice.com","sentAt":"2009-10-01T16:49:56Z","receivedAt":"2009-10-01T16:49:56Z","isPatch":false,"sender":{"key":"tom@dbservice.com","avatar":"https://gravatar.com/avatar/900a300bdd1a8bbe086008ad78210bbee2ad2803b7d50a5cba04c1e9404bd6d2?d=mp&s=160"},"body":"\nOn Oct 1, 2009, at 6:03 PM, Josef Wolf wrote:\n\n> Hello,\n>\n> One of my repositories has grown a subdirectory that I'd like to  \n> split off,\n> so other can use it as a subproject. With the help of google, I  \n> found this\n> solution:\n\nTake a look at git-subtree (http://github.com/apenwarr/git-subtree).\n\ntom\n"},{"id":"124100","messageId":"20091001211340.GB26068@raven.wolf.lan","threadId":"21106","inReplyTo":"c376da900910010949p197aa311l9c91ef711beffdf7@mail.gmail.com","subject":"Re: Trying to split repository","fromName":"Josef Wolf","fromEmail":"jw@raven.inka.de","sentAt":"2009-10-01T21:13:40Z","receivedAt":"2009-10-01T21:13:40Z","isPatch":false,"sender":{"key":"jw@raven.inka.de","avatar":null},"body":"On Thu, Oct 01, 2009 at 12:49:03PM -0400, Adam Brewster wrote:\n> >\n> > Any hints how to get rid of those log entries?\n> \n> git-filter-branch accepts a --prune-empty option that does what I\n> think you're looking for.\n\nThanks for your answer, Adam!\n\nIs this a new option? 1.6.0.2 don't seem to have it?\n"},{"id":"124107","messageId":"c376da900910011747i894404dne1ea60dae5e3990b@mail.gmail.com","threadId":"21106","inReplyTo":"20091001211340.GB26068@raven.wolf.lan","subject":"Re: Trying to split repository","fromName":"Adam Brewster","fromEmail":"adambrewster@gmail.com","sentAt":"2009-10-02T00:47:15Z","receivedAt":"2009-10-02T00:47:15Z","isPatch":false,"sender":{"key":"adambrewster@gmail.com","avatar":"https://avatars.githubusercontent.com/u/223816?v=4"},"body":">>\n>> git-filter-branch accepts a --prune-empty option that does what I\n>> think you're looking for.\n>\n> Thanks for your answer, Adam!\n>\n> Is this a new option? 1.6.0.2 don't seem to have it?\n\n1.6.0.2 was released September 2008 (git log -n1 v1.6.0.2).\n\nThis feature was added in October 2008.  (git blame\nDocumentation/git-filter-branch.txt; git log -n1 d3240d93).\n\nIt's still it is missing from the option summary in master though.\n\nAdam\n"},{"id":"124108","messageId":"1254444731-6852-1-git-send-email-adambrewster@gmail.com","threadId":"21106","inReplyTo":"c376da900910011747i894404dne1ea60dae5e3990b@mail.gmail.com","subject":"[PATCH] filter-branch: add --prune-empty to option summary","fromName":"Adam Brewster","fromEmail":"adambrewster@gmail.com","sentAt":"2009-10-02T00:52:11Z","receivedAt":"2009-10-02T00:52:11Z","isPatch":true,"sender":{"key":"adambrewster@gmail.com","avatar":"https://avatars.githubusercontent.com/u/223816?v=4"},"body":"Signed-off-by: Adam Brewster <adambrewster@gmail.com>\n---\n Documentation/git-filter-branch.txt |    1 +\n 1 files changed, 1 insertions(+), 0 deletions(-)\n\ndiff --git a/Documentation/git-filter-branch.txt b/Documentation/git-filter-branch.txt\nindex 451950b..2cc3bd8 100644\n--- a/Documentation/git-filter-branch.txt\n+++ b/Documentation/git-filter-branch.txt\n@@ -12,6 +12,7 @@ SYNOPSIS\n \t[--index-filter <command>] [--parent-filter <command>]\n \t[--msg-filter <command>] [--commit-filter <command>]\n \t[--tag-name-filter <command>] [--subdirectory-filter <directory>]\n+\t[--prune-empty]\n \t[--original <namespace>] [-d <directory>] [-f | --force]\n \t[--] [<rev-list options>...]\n \n-- \n1.6.0.6\n"},{"id":"124113","messageId":"20091002074537.GA27664@coredump.intra.peff.net","threadId":"21106","inReplyTo":"1254444731-6852-1-git-send-email-adambrewster@gmail.com","subject":"Re: [PATCH] filter-branch: add --prune-empty to option summary","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2009-10-02T07:45:37Z","receivedAt":"2009-10-02T07:45:37Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Thu, Oct 01, 2009 at 08:52:11PM -0400, Adam Brewster wrote:\n\n> diff --git a/Documentation/git-filter-branch.txt b/Documentation/git-filter-branch.txt\n> index 451950b..2cc3bd8 100644\n> --- a/Documentation/git-filter-branch.txt\n> +++ b/Documentation/git-filter-branch.txt\n> @@ -12,6 +12,7 @@ SYNOPSIS\n>  \t[--index-filter <command>] [--parent-filter <command>]\n>  \t[--msg-filter <command>] [--commit-filter <command>]\n>  \t[--tag-name-filter <command>] [--subdirectory-filter <directory>]\n> +\t[--prune-empty]\n>  \t[--original <namespace>] [-d <directory>] [-f | --force]\n>  \t[--] [<rev-list options>...]\n\nThanks. This makes sense given the existing structure, though I have to\nwonder how useful some of these gigantic synopses really are. Do we\nreally need to list all of the options here in a cluttered, annoyingly\nwrapped format, when we are just going to list them in a nice\neasy-to-read format with their descriptions later on in the page?\n\nAnd this is really not so much to do with your patch as a meta-rant, so\nfeel free to stop reading.\n\nWhat should the synopsis really be communicating? In something like\ngit-cat-file(1), the synopsis nicely shows a few key facts:\n\n  1. There are two \"modes\" if invocation.\n\n  2. In one mode, you give an action and an object on the command line.\n\n  3. In the other mode, you give --batch and feed some stuff over stdin.\n\nThose are all useful pieces of information, and they are communicated\nmore quickly than they would be by forcing me to read the\nparagraph-formatted text of the description section.\n\nBut look at the 18-line synopsis for git-grep or the 17-line one for\ngit-format-patch. Are they really helping anyone? (And it is not just\nthe line count. The 18-line synopsis for git-config is actually useful,\nbecause there really are 18 modes of operation).\n\nNon-git programs seem to take a more sparse approach. For example, some\none-line synopses from my system:\n\n       sed [OPTION]... {script-only-if-no-other-script} [input-file]...\n       ls [OPTION]... [FILE]...\n\nor even this longer one:\n\n       vim [options] [file ..]\n       vim [options] -\n       vim [options] -t tag\n       vim [options] -q [errorfile]\n\nThose all communicate some useful information (how to generally invoke\nthe program) cluttering it with redundant information.\n\n-Peff\n"},{"id":"124131","messageId":"c376da900910020718i3ddc1dd1x5eb966a693b477e2@mail.gmail.com","threadId":"21106","inReplyTo":"20091002074537.GA27664@coredump.intra.peff.net","subject":"Re: [PATCH] filter-branch: add --prune-empty to option summary","fromName":"Adam Brewster","fromEmail":"adambrewster@gmail.com","sentAt":"2009-10-02T14:18:03Z","receivedAt":"2009-10-02T14:18:03Z","isPatch":true,"sender":{"key":"adambrewster@gmail.com","avatar":"https://avatars.githubusercontent.com/u/223816?v=4"},"body":">\n> Thanks. This makes sense given the existing structure, though I have to\n> wonder how useful some of these gigantic synopses really are.\n\nI find them useful mostly when dealing with commands that I generally\nknow, but don't remember the exact spelling or ordering of the\noptions.  I might forget, for example, if it's --msg-filter or\n--message-filter.\n\nAdam\n"},{"id":"124136","messageId":"20091002154204.GC26068@raven.wolf.lan","threadId":"21106","inReplyTo":"c376da900910011747i894404dne1ea60dae5e3990b@mail.gmail.com","subject":"Re: Trying to split repository","fromName":"Josef Wolf","fromEmail":"jw@raven.inka.de","sentAt":"2009-10-02T15:42:04Z","receivedAt":"2009-10-02T15:42:04Z","isPatch":false,"sender":{"key":"jw@raven.inka.de","avatar":null},"body":"On Thu, Oct 01, 2009 at 08:47:15PM -0400, Adam Brewster wrote:\n> >>\n> >> git-filter-branch accepts a --prune-empty option that does what I\n> >> think you're looking for.\n> > Thanks for your answer, Adam!\n> > Is this a new option? 1.6.0.2 don't seem to have it?\n> 1.6.0.2 was released September 2008 (git log -n1 v1.6.0.2).\n> \n> This feature was added in October 2008.  (git blame\n> Documentation/git-filter-branch.txt; git log -n1 d3240d93).\n> \n> It's still it is missing from the option summary in master though.\n\nThanks for clarifying that, Adam!\n"}]}