public inbox for git@vger.kernel.org 
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox•com>
To: Lee Carver <Lee.Carver@servicenow•com>
Cc: "git\@vger.kernel.org" <git@vger•kernel.org>,
	Andreas Schwab <schwab@linux-m68k•org>,
	Lee Carver <leeca@pnambic•com>,
	Stefano Lattarini <stefano.lattarini@gmail•com>
Subject: Re: [PATCH-v3] Allow git-filter-branch to process large repositories with lots of branches.
Date: Tue, 10 Sep 2013 16:20:01 -0700	[thread overview]
Message-ID: <xmqqli34uuvy.fsf@gitster.dls.corp.google.com> (raw)
In-Reply-To: <CE54F01A.19632%lee.carver@corp.service-now.com> (Lee Carver's message of "Tue, 10 Sep 2013 22:55:35 +0000")

Lee Carver <Lee.Carver@servicenow•com> writes:

> As noted in several forums, a recommended way to move trees between
> repositories
> is to use git-filter-branch to revise the history for a single tree:
>
> http://gbayer.com/development/moving-files-from-one-git-repository-to-anoth
> er-preserving-history/
> http://stackoverflow.com/questions/1365541/how-to-move-files-from-one-git-r
> epo-to-another-not-a-clone-preserving-history
>
> However, this can lead to argument list too long errors when the original
> repository has many retained branches (>6k)
>
> /usr/local/git/libexec/git-core/git-filter-branch: line 270:
> /usr/local/git/libexec/git-core/git: Argument list too long
> Could not get the commits
>
> Piping the saved output from git rev-parse into git rev-list avoids this
> problem, since the rev-parse output is not processed as a command line
> argument.
> ---
>  git-filter-branch.sh | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/git-filter-branch.sh b/git-filter-branch.sh
> index ac2a005..2091885 100755
> --- a/git-filter-branch.shgit
> +++ b/git-filter-branch.sh
> @@ -255,7 +255,7 @@ else
>  	remap_to_ancestor=t
>  fi
>  
> -rev_args=$(git rev-parse --revs-only "$@")
> +git rev-parse --revs-only "$@" > ../parse

Where is this "rev-parse" command running?  Is it always safe to
clobber the file "../parse" like this?

>  
>  case "$filter_subdir" in
>  "")
> @@ -268,7 +268,7 @@ case "$filter_subdir" in
>  esac
>  
>  git rev-list --reverse --topo-order --default HEAD \
> -	--parents --simplify-merges $rev_args "$@" > ../revs ||
> +	--parents --simplify-merges --stdin "$@" < ../parse > ../revs ||
>  	die "Could not get the commits"
>  commits=$(wc -l <../revs | tr -d " ")

  reply	other threads:[~2013-09-10 23:20 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-07 21:03 [PATCH-v2] Allow git-filter-branch to process large repositories with lots of branches Lee Carver
2013-09-07 23:06 ` Stefano Lattarini
2013-09-10 22:55   ` [PATCH-v3] " Lee Carver
2013-09-10 23:20     ` Junio C Hamano [this message]
2013-09-11  0:21       ` Lee Carver
2013-09-11 16:06         ` Junio C Hamano
2013-09-12 17:46           ` [PATCH-v4] " Lee Carver

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=xmqqli34uuvy.fsf@gitster.dls.corp.google.com \
    --to=gitster@pobox$(echo .)com \
    --cc=Lee.Carver@servicenow$(echo .)com \
    --cc=git@vger$(echo .)kernel.org \
    --cc=leeca@pnambic$(echo .)com \
    --cc=schwab@linux-m68k$(echo .)org \
    --cc=stefano.lattarini@gmail$(echo .)com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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