Re: [PATCH] git-filter-branch.txt: mention absolute path for scripts in --tree-filter

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Jari Aalto schrieb:
> J6t:
>> Your choice of words is ambiguous: The --tree-filter is not the name of a
>> shell script, but rather the shell script itself; the example you gave is
>> just a shell script that happens to run only a shell on a file whose name
>> must be specified as an absolute path.
> 
> Full context was:
> 
>     --tree-filter <command>::
>             This is the filter for rewriting the tree and its contents.
>             The argument is evaluated in shell with the working
>             directory set to the root of the checked out tree.  The new tree
>             is then used as-is (new files are auto-added, disappeared files
>             are auto-removed - neither .gitignore files nor any other ignore
>             rules *HAVE ANY EFFECT*!).
>     +
>     In case the <command> is a shell script, provide an absolute path.
>     An example: --tree-filter 'sh /path/to/filter.sh'

I am complaining that you say "In case the <command> is a shell
script...".  There are no other cases; <command> is always a shell script.

What you meant to say is: "If you have your filter written down in a
separate shell script, you must invoke it using an absolute path, for
example, --tree-filter '/path/to/filter.sh'".

>> But doesn't the recommendation to use absolute paths apply not only to
>> --tree-filters, but
>>
>> - to all filters;
>>
>> - to all references to external files that the filters make.
> 
> I don't know.

It was a rethoric question. The hint about paths to files outside the
working directory should go to the general description of filters.

>     cd <gir repo>
>     git filter-branch  --tree-filter "sh $(pwd)/filter.sh" HEAD
> 
> And that didn't work quit either. Script was run, but paths weren't no
> longer relative to the "working dir" I was cd'd to:
> 
>     rm  file \
>         dir/file \
>         dir/file \
>         ..

I don't understand what you are trying to say, and I don't understand why
it helped to run

  git filter-branch  --tree-filter "sh /the/git/repo/filter.sh" HEAD

when the above did not work - from filter-branch's POV there is simply no
difference between the two invocations.

-- Hannes

PS: Please keep Cc list.
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]