git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Elijah Newren <newren@gmail.com>
To: Jeff King <peff@peff.net>
Cc: Mike Ralphson <mike.ralphson@gmail.com>,
	Git Mailing List <git@vger.kernel.org>
Subject: Re: [ANNOUNCE] EasyGit (eg) 0.97
Date: Fri, 30 Jan 2009 13:21:00 -0700	[thread overview]
Message-ID: <51419b2c0901301221n45cde1abw7a57a13bfa74b34@mail.gmail.com> (raw)
In-Reply-To: <20090130194727.GA31927@coredump.intra.peff.net>

On Fri, Jan 30, 2009 at 12:47 PM, Jeff King <peff@peff.net> wrote:
> As an aside, I found some related weirdness. In my git repo, if I do
> this:
>
>  $ git checkout next
>  $ eg log -p
>
> I get log output, but the diff is not colorized (and I have color.diff
> set to "auto" in my ~/.gitconfig). But if I detach my HEAD and show the
> log:
>
>  $ git checkout next^0
>  $ eg log -p
>
> then I _do_ get color in the patch. I also get this error:

Hmm, I had never turned color on before; I guess other eg users hadn't
either.  Anyway, the difference can be explained pretty easily:  eg
log tries to provide user-meaningful names for how commits relate to
the active branch (like git-name-rev but implemented internally in eg
to allow the common case to be fast); if there is no active branch
there's no special naming to do so I simply run git log without
reading and modifying its output.

Essentially, the difference in coloring here is much like the
difference you see between

$ git log
$ git log | less

Whenever I try to load the output in perl, git won't show the
colorization.  I guess I could manually add it when I am printing the
information, but it'd be nicer to just have git do the colorization
despite the fact that its output is not a tty.  Is there an easy way
to do that (without mucking with the user's config file)?

(It looks like eg status is also affected, for similar reasons.)

>  Use of uninitialized value $branch in concatenation (.) or string at
>  /home/peff/eg line 2854.
>  eg: command (git rev-parse refs/heads/) failed
>  eg: received signal 13
>
> The error is easy to explain. The offending code is:
>
>    my $branch = RepoUtil::current_branch();
>    my ($ret, $revision) =
>      ExecUtil::execute_captured("git rev-parse refs/heads/$branch");

Indeed, the latter two lines should have been after the if (!$branch) check.


Thanks,
Elijah

  parent reply	other threads:[~2009-01-30 20:22 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-30 16:42 [ANNOUNCE] EasyGit (eg) 0.97 Elijah Newren
2009-01-30 16:59 ` Mike Ralphson
2009-01-30 18:35   ` Elijah Newren
2009-01-30 19:47     ` Jeff King
2009-01-30 20:03       ` Jeff King
2009-01-30 20:22         ` Elijah Newren
2009-01-30 20:21       ` Elijah Newren [this message]
2009-01-30 20:29         ` Jeff King
2009-01-30 22:55           ` Elijah Newren
2009-01-31  7:25             ` Jeff King

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=51419b2c0901301221n45cde1abw7a57a13bfa74b34@mail.gmail.com \
    --to=newren@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=mike.ralphson@gmail.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).