Re: [tig] Feeding specific revisions to tig

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

 



On Fri, Aug 8, 2008 at 23:19, Jeff King <peff@xxxxxxxx> wrote:
> On Wed, Aug 06, 2008 at 01:06:51PM +0200, Jonas Fonseca wrote:
>> I actually added something that let's you alter the command executed
>> for each view. So here is another possibility that can be used:
>>
>> function tignowalk ()
>> {
>>    tmp=$(mktemp) # or .git/tigfiles or similar
>>    # Safe stuff from "stdin" and run tig with custom rev-list command
>>    cat > "$tmp
>>    TIG_MAIN_CMD="git rev-list --pretty=raw --no-walk --stdin < $tmp"
>> tig < /dev/tty
>>    rm "$tmp"
>> }
>
> Neat, if a bit hack-ish. :) You are missing a closing quotation mark
> after
>
>  cat > "$tmp
>
> and the line break between TIG_MAIN_CMD and tig is obviously problematic
> (presumably an artifact of the email, but it confused my cut and paste
> efforts for a minute). One other thing to note is that even though you
> try to handle a $tmp with whitespace in the cat and rm commands, I
> suspect it would fail when tig hands TIG_MAIN_CMD to the shell. That
> would require double-quoting.

Yes, this way to "hook" into tig is a bit hackish and gives some
problems with handling files. But then again, it is hidden away in
env. variables, which seems very effective in not getting it too
exposed. :)

> So here is my cut-and-pastable version:
>
>  tignowalk() {
>    tmp=$(mktemp)
>    cat >"$tmp"
>    TIG_MAIN_CMD="git rev-list --pretty=raw --no-walk --stdin <$tmp" \
>      tig </dev/tty
>    rm "$tmp"
>  }

Thanks for the fixed up version.

-- 
Jonas Fonseca
--
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]

  Powered by Linux