From: David Kastrup Date: Fri, 31 Aug 2007 06:13:36 GMT Subject: Re: [PATCH] git-filter-branch: document --original option Message-ID: <85642wcju7.fsf@lola.goethe.zz> In-Reply-To: <7vodgo7jbn.fsf@gitster.siamese.dyndns.org> Junio C Hamano writes: > David Kastrup writes: > >> Junio C Hamano writes: >> ... >>> --original) >>> + case "$OPTARG" in */) ;; *) OPTARG="$OPTARG/" ;; esac >>> orig_namespace="$OPTARG" >>> ;; >>> *) >> >> orig_namespace="${OPTARG%/}/" >> >> Sure, it does not win the "portable to Version 7" price, but our >> scripts don't do that, anyway. > > I agree we do not give the "portable to version 7" prize > anymore. But you made me realize another thing. > > I think it should make sure orig_namespace has one and only one > trailing slash, because otherwise "--original refs/heads//" > would lead you to the same disaster. I am not sure we should bend over backwards to people courting disaster. Completion does not add double slashes, and that's the most common cause for spurious slashes. And I don't know an equally straightforward way to remove multiple slashes at the end. do orig_namespace="$OPTARG";OPTARG="${OPTARG%/}/" while test "X${orig_namespace}" != "X${OPTARG}" is not really all too pretty. -- David Kastrup, Kriemhildstr. 15, 44793 Bochum