All of lore.kernel.org
 help / color / mirror / Atom feed
From: Johannes Sixt <J.Sixt@eudaptics.com>
To: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Cc: Johannes Sixt <johannes.sixt@telecom.at>,
	gitster@pobox.com, git@vger.kernel.org
Subject: [PATCH take 2] filter-branch: Avoid an error message in the map  function.
Date: Wed, 04 Jul 2007 14:08:17 +0200	[thread overview]
Message-ID: <468B8DB1.9A4CF1E6@eudaptics.com> (raw)
In-Reply-To: Pine.LNX.4.64.0707041247520.4071@racer.site

When the map function didn't find the rewritten commit of the passed in
original id, it printed the original id, but it still fell through to
the 'cat', which failed with an error message.

Signed-off-by: Johannes Sixt <johannes.sixt@telecom.at>
---
 git-filter-branch.sh |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/git-filter-branch.sh b/git-filter-branch.sh
index 22fb5bf..5fa9b61 100644
--- a/git-filter-branch.sh
+++ b/git-filter-branch.sh
@@ -16,8 +16,12 @@
 map()
 {
 	# if it was not rewritten, take the original
-	test -r "$workdir/../map/$1" || echo "$1"
-	cat "$workdir/../map/$1"
+	if test -r "$workdir/../map/$1"
+	then
+		cat "$workdir/../map/$1"
+	else
+		echo "$1"
+	fi
 }
 
 # When piped a commit, output a script to set the ident of either
-- 
1.5.3.rc0.5.g7cd9

  reply	other threads:[~2007-07-04 12:07 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-07-04  7:54 [PATCH] filter-branch: Avoid an error message in the map function Johannes Sixt
2007-07-04 11:08 ` Johannes Schindelin
2007-07-04 11:45   ` Johannes Sixt
2007-07-04 11:49     ` Johannes Schindelin
2007-07-04 12:08       ` Johannes Sixt [this message]
2007-07-04 12:51         ` [PATCH take 2] " Johannes Schindelin

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=468B8DB1.9A4CF1E6@eudaptics.com \
    --to=j.sixt@eudaptics.com \
    --cc=Johannes.Schindelin@gmx.de \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=johannes.sixt@telecom.at \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.