git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jonas Fonseca <fonseca@diku.dk>
To: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Cc: Jakub Narebski <jnareb@gmail.com>, git@vger.kernel.org
Subject: Re: [PATCH] Add git-filter-branch
Date: Tue, 5 Jun 2007 12:18:45 +0200	[thread overview]
Message-ID: <20070605101845.GA16160@diku.dk> (raw)
In-Reply-To: <Pine.LNX.4.64.0706030147520.4046@racer.site>

Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote Sun, Jun 03, 2007:
> Second, it does not even need bash.
> 
> At least that is what I tried to make sure. I replaced the only instance 
> of a bashim I was aware, namely the arrayism of $unchanged. It can be a 
> string just as well, as we are only storing object names in it.
> 
> Tell me if it does not work for you.
> 
> Or even better, provide me with a test case that fails for you.

I found a small problem when /bin/sh is linked to dash.

$ /bin/dash t*-filter-branch.sh
*   ok 1: setup
* FAIL 2: rewrite identically

                git-filter-branch H2

* FAIL 3: result is really identical

                test $H = $(git-rev-parse H2)

* FAIL 4: rewrite, renaming a specific file

                git-filter-branch --tree-filter "mv d doh || :" H3

* FAIL 5: test that the file was renamed

                test d = $(git show H3:doh)

* failed 4 among 5 test(s)
$ cd trash/
$ rm -rf .git-rewrite/
$ git filter-branch H2
/home/fonseca/bin/git-filter-branch: 386: arith: syntax error: "i+1"
$

A possible fix that makes the test pass for me.

diff --git a/git-filter-branch.sh b/git-filter-branch.sh
index 0c8a7df..5cf9d3c 100644
--- a/git-filter-branch.sh
+++ b/git-filter-branch.sh
@@ -339,7 +339,7 @@ test $commits -eq 0 && die "Found nothing to rewrite"
 
 i=0
 while read commit; do
-	i=$((i+1))
+	i=$(echo i+1 | bc)
 	printf "$commit ($i/$commits) "
 
 	git-read-tree -i -m $commit

-- 
Jonas Fonseca

  parent reply	other threads:[~2007-06-05 10:18 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-06-03  0:31 [PATCH] Add git-filter-branch Johannes Schindelin
2007-06-03  0:46 ` Jakub Narebski
2007-06-03  0:50   ` Johannes Schindelin
2007-06-03 10:28     ` Jakub Narebski
2007-06-03 18:36       ` Steven Grimm
2007-06-03 23:07       ` Johannes Schindelin
2007-06-05 10:18     ` Jonas Fonseca [this message]
2007-06-05 10:26       ` David Kastrup
2007-06-05 10:30       ` Junio C Hamano
2007-06-05 10:34         ` Jonas Fonseca
2007-06-05 13:55           ` Johannes Schindelin
2007-06-06 15:24           ` [PATCH] filter-branch: use $(($i+1)) instead of $((i+1)) Johannes Schindelin
2007-06-04  7:18 ` [PATCH] Add git-filter-branch Johannes Sixt
2007-06-04  7:59   ` Johannes Sixt
2007-06-04 16:11   ` Johannes Schindelin
2007-06-04 16:34     ` Johannes Sixt
2007-06-04 17:55       ` Johannes Schindelin
2007-06-05  7:01         ` Johannes Sixt
2007-06-05 15:58           ` Johannes Schindelin
2007-06-06  7:43             ` Johannes Sixt
2007-06-06  8:17               ` Junio C Hamano
2007-06-06 15:00               ` Johannes Schindelin
2007-06-06 15:22                 ` Johannes Sixt
2007-06-06 17:59                   ` Johannes Schindelin
2007-06-06 15:36             ` [PATCH] filter-branch: also don't fail in map() if a commit cannot be mapped Johannes Sixt
2007-06-06 17:50               ` Johannes Schindelin
2007-06-06 18:38                 ` [PATCH v2] " 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=20070605101845.GA16160@diku.dk \
    --to=fonseca@diku.dk \
    --cc=Johannes.Schindelin@gmx.de \
    --cc=git@vger.kernel.org \
    --cc=jnareb@gmail.com \
    /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).