* Trying to split repository
@ 2009-10-01 16:03 Josef Wolf
2009-10-01 16:49 ` Adam Brewster
2009-10-01 16:49 ` Tomas Carnecky
0 siblings, 2 replies; 9+ messages in thread
From: Josef Wolf @ 2009-10-01 16:03 UTC (permalink / raw)
To: git
Hello,
One of my repositories has grown a subdirectory that I'd like to split off,
so other can use it as a subproject. With the help of google, I found this
solution:
# first extract the library from the original repository
#
git clone --no-hardlinks repository library.tmp
(
cd library.tmp
git filter-branch --subdirectory-filter CF -- --all
git reset --hard
git gc --aggressive
git prune
git gc
git clone --bare . ../library
)
rm -rf library.tmp
# Now remove the library from the original repository, so it can be
# included as a subproject
#
git clone --no-hardlinks repository repository.new.tmp
(
cd repository.new.tmp
git filter-branch \
--index-filter "git rm -r -f --cached --ignore-unmatch CF" \
-- --all
git reset --hard
git gc --aggressive
git prune
git gc
git clone --bare . ../repository.new
)
rm -rf repository.new.tmp
This works fine. But there's one problem, though. "gitk --all" in the new
repository still shows all the history of the removed library. The patch
show no modifications, but the log entry is still there.
Any hints how to get rid of those log entries?
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Trying to split repository
2009-10-01 16:03 Trying to split repository Josef Wolf
@ 2009-10-01 16:49 ` Adam Brewster
2009-10-01 21:13 ` Josef Wolf
2009-10-01 16:49 ` Tomas Carnecky
1 sibling, 1 reply; 9+ messages in thread
From: Adam Brewster @ 2009-10-01 16:49 UTC (permalink / raw)
To: Josef Wolf, git
>
> Any hints how to get rid of those log entries?
git-filter-branch accepts a --prune-empty option that does what I
think you're looking for.
Adam
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Trying to split repository
2009-10-01 16:03 Trying to split repository Josef Wolf
2009-10-01 16:49 ` Adam Brewster
@ 2009-10-01 16:49 ` Tomas Carnecky
1 sibling, 0 replies; 9+ messages in thread
From: Tomas Carnecky @ 2009-10-01 16:49 UTC (permalink / raw)
To: Josef Wolf; +Cc: git
On Oct 1, 2009, at 6:03 PM, Josef Wolf wrote:
> Hello,
>
> One of my repositories has grown a subdirectory that I'd like to
> split off,
> so other can use it as a subproject. With the help of google, I
> found this
> solution:
Take a look at git-subtree (http://github.com/apenwarr/git-subtree).
tom
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Trying to split repository
2009-10-01 16:49 ` Adam Brewster
@ 2009-10-01 21:13 ` Josef Wolf
2009-10-02 0:47 ` Adam Brewster
0 siblings, 1 reply; 9+ messages in thread
From: Josef Wolf @ 2009-10-01 21:13 UTC (permalink / raw)
To: git
On Thu, Oct 01, 2009 at 12:49:03PM -0400, Adam Brewster wrote:
> >
> > Any hints how to get rid of those log entries?
>
> git-filter-branch accepts a --prune-empty option that does what I
> think you're looking for.
Thanks for your answer, Adam!
Is this a new option? 1.6.0.2 don't seem to have it?
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Trying to split repository
2009-10-01 21:13 ` Josef Wolf
@ 2009-10-02 0:47 ` Adam Brewster
2009-10-02 0:52 ` [PATCH] filter-branch: add --prune-empty to option summary Adam Brewster
2009-10-02 15:42 ` Trying to split repository Josef Wolf
0 siblings, 2 replies; 9+ messages in thread
From: Adam Brewster @ 2009-10-02 0:47 UTC (permalink / raw)
To: Josef Wolf, git
>>
>> git-filter-branch accepts a --prune-empty option that does what I
>> think you're looking for.
>
> Thanks for your answer, Adam!
>
> Is this a new option? 1.6.0.2 don't seem to have it?
1.6.0.2 was released September 2008 (git log -n1 v1.6.0.2).
This feature was added in October 2008. (git blame
Documentation/git-filter-branch.txt; git log -n1 d3240d93).
It's still it is missing from the option summary in master though.
Adam
^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH] filter-branch: add --prune-empty to option summary
2009-10-02 0:47 ` Adam Brewster
@ 2009-10-02 0:52 ` Adam Brewster
2009-10-02 7:45 ` Jeff King
2009-10-02 15:42 ` Trying to split repository Josef Wolf
1 sibling, 1 reply; 9+ messages in thread
From: Adam Brewster @ 2009-10-02 0:52 UTC (permalink / raw)
To: git; +Cc: Adam Brewster
Signed-off-by: Adam Brewster <adambrewster@gmail.com>
---
Documentation/git-filter-branch.txt | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/Documentation/git-filter-branch.txt b/Documentation/git-filter-branch.txt
index 451950b..2cc3bd8 100644
--- a/Documentation/git-filter-branch.txt
+++ b/Documentation/git-filter-branch.txt
@@ -12,6 +12,7 @@ SYNOPSIS
[--index-filter <command>] [--parent-filter <command>]
[--msg-filter <command>] [--commit-filter <command>]
[--tag-name-filter <command>] [--subdirectory-filter <directory>]
+ [--prune-empty]
[--original <namespace>] [-d <directory>] [-f | --force]
[--] [<rev-list options>...]
--
1.6.0.6
^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [PATCH] filter-branch: add --prune-empty to option summary
2009-10-02 0:52 ` [PATCH] filter-branch: add --prune-empty to option summary Adam Brewster
@ 2009-10-02 7:45 ` Jeff King
2009-10-02 14:18 ` Adam Brewster
0 siblings, 1 reply; 9+ messages in thread
From: Jeff King @ 2009-10-02 7:45 UTC (permalink / raw)
To: Adam Brewster; +Cc: git
On Thu, Oct 01, 2009 at 08:52:11PM -0400, Adam Brewster wrote:
> diff --git a/Documentation/git-filter-branch.txt b/Documentation/git-filter-branch.txt
> index 451950b..2cc3bd8 100644
> --- a/Documentation/git-filter-branch.txt
> +++ b/Documentation/git-filter-branch.txt
> @@ -12,6 +12,7 @@ SYNOPSIS
> [--index-filter <command>] [--parent-filter <command>]
> [--msg-filter <command>] [--commit-filter <command>]
> [--tag-name-filter <command>] [--subdirectory-filter <directory>]
> + [--prune-empty]
> [--original <namespace>] [-d <directory>] [-f | --force]
> [--] [<rev-list options>...]
Thanks. This makes sense given the existing structure, though I have to
wonder how useful some of these gigantic synopses really are. Do we
really need to list all of the options here in a cluttered, annoyingly
wrapped format, when we are just going to list them in a nice
easy-to-read format with their descriptions later on in the page?
And this is really not so much to do with your patch as a meta-rant, so
feel free to stop reading.
What should the synopsis really be communicating? In something like
git-cat-file(1), the synopsis nicely shows a few key facts:
1. There are two "modes" if invocation.
2. In one mode, you give an action and an object on the command line.
3. In the other mode, you give --batch and feed some stuff over stdin.
Those are all useful pieces of information, and they are communicated
more quickly than they would be by forcing me to read the
paragraph-formatted text of the description section.
But look at the 18-line synopsis for git-grep or the 17-line one for
git-format-patch. Are they really helping anyone? (And it is not just
the line count. The 18-line synopsis for git-config is actually useful,
because there really are 18 modes of operation).
Non-git programs seem to take a more sparse approach. For example, some
one-line synopses from my system:
sed [OPTION]... {script-only-if-no-other-script} [input-file]...
ls [OPTION]... [FILE]...
or even this longer one:
vim [options] [file ..]
vim [options] -
vim [options] -t tag
vim [options] -q [errorfile]
Those all communicate some useful information (how to generally invoke
the program) cluttering it with redundant information.
-Peff
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] filter-branch: add --prune-empty to option summary
2009-10-02 7:45 ` Jeff King
@ 2009-10-02 14:18 ` Adam Brewster
0 siblings, 0 replies; 9+ messages in thread
From: Adam Brewster @ 2009-10-02 14:18 UTC (permalink / raw)
To: Jeff King; +Cc: git
>
> Thanks. This makes sense given the existing structure, though I have to
> wonder how useful some of these gigantic synopses really are.
I find them useful mostly when dealing with commands that I generally
know, but don't remember the exact spelling or ordering of the
options. I might forget, for example, if it's --msg-filter or
--message-filter.
Adam
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Trying to split repository
2009-10-02 0:47 ` Adam Brewster
2009-10-02 0:52 ` [PATCH] filter-branch: add --prune-empty to option summary Adam Brewster
@ 2009-10-02 15:42 ` Josef Wolf
1 sibling, 0 replies; 9+ messages in thread
From: Josef Wolf @ 2009-10-02 15:42 UTC (permalink / raw)
To: git
On Thu, Oct 01, 2009 at 08:47:15PM -0400, Adam Brewster wrote:
> >>
> >> git-filter-branch accepts a --prune-empty option that does what I
> >> think you're looking for.
> > Thanks for your answer, Adam!
> > Is this a new option? 1.6.0.2 don't seem to have it?
> 1.6.0.2 was released September 2008 (git log -n1 v1.6.0.2).
>
> This feature was added in October 2008. (git blame
> Documentation/git-filter-branch.txt; git log -n1 d3240d93).
>
> It's still it is missing from the option summary in master though.
Thanks for clarifying that, Adam!
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2009-10-02 15:50 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-10-01 16:03 Trying to split repository Josef Wolf
2009-10-01 16:49 ` Adam Brewster
2009-10-01 21:13 ` Josef Wolf
2009-10-02 0:47 ` Adam Brewster
2009-10-02 0:52 ` [PATCH] filter-branch: add --prune-empty to option summary Adam Brewster
2009-10-02 7:45 ` Jeff King
2009-10-02 14:18 ` Adam Brewster
2009-10-02 15:42 ` Trying to split repository Josef Wolf
2009-10-01 16:49 ` Tomas Carnecky
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).