git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Johannes Sixt <j6t@kdbg.org>
To: Thomas Rast <trast@student.ethz.ch>
Cc: jeffrey.freeman@syncleus.com, git@vger.kernel.org
Subject: Re: [RFC PATCH 1/3] filter-branch: optionally dump all mappings at the end
Date: Fri, 31 Dec 2010 18:09:24 +0100	[thread overview]
Message-ID: <201012311809.24205.j6t@kdbg.org> (raw)
In-Reply-To: <57609f1df897f19becc77d5c43c3c3608725160b.1293809100.git.trast@student.ethz.ch>

On Freitag, 31. Dezember 2010, Thomas Rast wrote:
> In some cases, like the sub/super-project filtering attempted in this
> series, it may be necessary to carry over the mappings from one or
> more filter-branch run to another.
>
> As the first part to this, make a --dump-map option that dumps a flat
> text file with lines of the form
>
>   $sha1 $(map $sha1)

Despite the alternative implementation that I suggest below, the commit 
message (and also the documentation to be written) should state the output 
format in this way.

> @@ -194,6 +195,16 @@ do
>  	--original)
>  		orig_namespace=$(expr "$OPTARG/" : '\(.*[^/]\)/*$')/
>  		;;
> +	--dump-map)
> +		case "$OPTARG" in
> +		/*)

Please use

	if is_absolute_path "$OPTARG"
	then
	...

> +# At this point the mappings are stable so we can dump them if
> +# requested
> +
> +if test -n "$dump_map"; then
> +	( cd "$workdir"/../map/; ls ) |
> +	while read sha1; do
> +		echo $sha1 $(map $sha1)

There must be a more efficient way than to spawn an additional process for 
each mapped SHA1. Since this excercises only one branch in the map() function 
anyway, how about this:

	( cd "$workdir"/../map/ && ls -1 ) |
	while read sha1; do
		read mapped << $sha1 &&
		echo $sha1 $mapped
	done > "$dump_map"

Though, there is some mechanism that maps one SHA1s to more than one, and my 
approach might not cover that case.

> +	done > "$dump_map"

-- Hannes

  reply	other threads:[~2010-12-31 17:10 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-31 15:29 [RFC PATCH 0/3] Submodule filtering for filter-branch Thomas Rast
2010-12-31 15:29 ` [RFC PATCH 1/3] filter-branch: optionally dump all mappings at the end Thomas Rast
2010-12-31 17:09   ` Johannes Sixt [this message]
2010-12-31 15:29 ` [RFC PATCH 2/3] filter-branch: optionally load existing mappings prior to filtering Thomas Rast
2010-12-31 17:10   ` Johannes Sixt
2010-12-31 15:29 ` [RFC PATCH 3/3] filter-branch: support --submodule-filter Thomas Rast
2010-12-31 17:31   ` Johannes Sixt
2011-01-03 23:44   ` Jeffrey Phillips Freeman
2011-01-04 13:14     ` Thomas Rast
2011-01-04 19:18       ` Junio C Hamano
2010-12-31 17:20 ` [RFC PATCH 0/3] Submodule filtering for filter-branch Johannes Sixt

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=201012311809.24205.j6t@kdbg.org \
    --to=j6t@kdbg.org \
    --cc=git@vger.kernel.org \
    --cc=jeffrey.freeman@syncleus.com \
    --cc=trast@student.ethz.ch \
    /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).