git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] git-filter-branch: document --original option

From
David Kastrup <dak@gnu.org>
Date
Aug 31, 2007, 06:13 UTC
Message-ID
<85642wcju7.fsf@lola.goethe.zz>
In-Reply-To
<7vodgo7jbn.fsf@gitster.siamese.dyndns.org>
Junio C Hamano <gitster@pobox.com> writes:
Show 21 quoted lines
> David Kastrup <dak@gnu.org> writes:
>
>> Junio C Hamano <gitster@pobox.com> 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
Previous: David KastrupNext: Johannes Schindelin
Message 11 of 12 in “git-filter-branch: more detailed USAGE”
  1. git-filter-branch: more detailed USAGEGiuseppe Bilotta, Aug 30, 2007
  2. Johannes SixtAug 30, 2007
  3. Giuseppe BilottaAug 30, 2007
  4. git-filter-branch: more detailed USAGEGiuseppe Bilotta, Aug 30, 2007
  5. git-filter-branch: document --original optionGiuseppe Bilotta, Aug 30, 2007
  6. Junio C HamanoAug 30, 2007
  7. David KastrupAug 30, 2007
  8. Junio C HamanoAug 30, 2007
  9. Junio C HamanoAug 30, 2007
  10. David KastrupAug 31, 2007
  11. David KastrupAug 31, 2007
  12. Johannes SchindelinAug 30, 2007

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.