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

Re: [ANNOUNCE] EasyGit (eg) 0.97

From
Elijah Newren <newren@gmail.com>
Date
Jan 30, 2009, 20:21 UTC
Message-ID
<51419b2c0901301221n45cde1abw7a57a13bfa74b34@mail.gmail.com>
In-Reply-To
<20090130194727.GA31927@coredump.intra.peff.net>
On Fri, Jan 30, 2009 at 12:47 PM, Jeff King <peff@peff.net> wrote:
Show 14 quoted lines
> 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.)
Show 10 quoted lines
>  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

Previous: Elijah NewrenNext: Jeff King
Message 7 of 10 in “[ANNOUNCE] EasyGit (eg) 0.97”
  1. Elijah NewrenJan 30, 2009
  2. Mike RalphsonJan 30, 2009
  3. Elijah NewrenJan 30, 2009
  4. Jeff KingJan 30, 2009
  5. Jeff KingJan 30, 2009
  6. Elijah NewrenJan 30, 2009
  7. Elijah NewrenJan 30, 2009
  8. Jeff KingJan 30, 2009
  9. Elijah NewrenJan 30, 2009
  10. Jeff KingJan 31, 2009

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.