Re: linking libgit.a in C++ projects

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

 




On Thu, 31 Jul 2008, cte wrote:
>
> Instead, git-log had to be altered to address gitk's needs, and an 
> option was added that users don't typically use.

Actually, no. 

I ended up doing a hack to add "git log --early-output", and some quick 
hacks to make git use it. But I'm happy to say that gitk doesn't use it 
any more. Gitk just parses the normal git log output, although obviously 
it ends up needing enough data to be able to fill in the gaps (ie it uses 
the "--parents" flag to get the rewritten parenthood info and the merges 
to keep it together).

So yeah, we have some options that enable output that simply doesn't make 
_sense_ to humans, but does when you are post-processing it (git has 
always had those, since it very much was about scripting from day one), 
but no, at least gitk doesn't use any really odd ones.

It literally does

	git log --no-color -z --pretty=raw --parents --boundary

(plus the args the user gave it). The --no-color turns off color if it's 
enabled by default.

The -z makes it the git log output a bit easier to parse by using a NUL 
character between commits.

The --pretty=raw is just to give the full/raw commit info - like giving 
the timestamps in the native raw format that is much easier to parse than 
any human-readable format.

The --parents I already mentioned - it is what makes you able to stitch 
the commits together (and it's useful for other things too: any scripts 
that look for merges will tend to use it, for example)

And the --boundary is to show the commits that aren't part of the actual 
selected set in gray.

It's all pretty generic, in other words. The -z option is purely for 
machine parsing, the others _can_ actually be useful even for humans (eg, 
--boundary together with --left-right and --pretty=oneline actually is 
very readable if you are used to that format).

So it's very true that git in general is geared towards scripting (and 
we've often added things to make it even more so), but no, your particular 
complaint isn't true. gitk doesn't do anything really strange.

		Linus
--
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