From: "Jonas Fonseca" <jonas.fonseca@gmail.com>
To: "Jeff King" <peff@peff.net>
Cc: "Jean-Baptiste Quenot" <jbq@caraldi.com>, git@vger.kernel.org
Subject: Re: [tig] Feeding specific revisions to tig
Date: Sun, 10 Aug 2008 11:16:37 +0200 [thread overview]
Message-ID: <2c6b72b30808100216j2c719bf2yb7dfba651db901e3@mail.gmail.com> (raw)
In-Reply-To: <20080808211916.GA30583@sigill.intra.peff.net>
On Fri, Aug 8, 2008 at 23:19, Jeff King <peff@peff.net> 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
next prev parent reply other threads:[~2008-08-10 9:18 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-06-04 18:52 [tig] Feeding specific revisions to tig Jean-Baptiste Quenot
2008-06-04 19:29 ` Jeff King
2008-06-04 20:04 ` Jean-Baptiste Quenot
2008-06-04 23:08 ` Jeff King
2008-08-06 11:06 ` Jonas Fonseca
2008-08-08 21:19 ` Jeff King
2008-08-10 9:16 ` Jonas Fonseca [this message]
2009-04-23 14:55 ` Jean-Baptiste Quenot
2009-04-27 10:21 ` Jonas Fonseca
2009-04-28 8:15 ` Jean-Baptiste Quenot
2011-09-15 15:10 ` Jean-Baptiste Quenot
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=2c6b72b30808100216j2c719bf2yb7dfba651db901e3@mail.gmail.com \
--to=jonas.fonseca@gmail.com \
--cc=git@vger.kernel.org \
--cc=jbq@caraldi.com \
--cc=peff@peff.net \
/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).