Re: help with git usage
- From
- Daniel Quinlan <danq@brtt.com>
- Date
- May 7, 2008, 22:41 UTC
- Message-ID
- <200805072242.m47Mg1o0015578@rs40.luxsci.com>
- In-Reply-To
- <m3tzhjokox.fsf@localhost.localdomain>
Thanks for your earlier responses, they were very helpful.
On Apr 30, 2008, at 1:39 AM, Jakub Narebski wrote:
Show 10 quoted lines
> Daniel Barkalow <barkalow@iabervon.org> writes: > >> On Tue, 29 Apr 2008, Daniel Quinlan wrote: >> >>> I've been trying to use git for awhile now, (and I've read a lot >>> of documentation, though maybe my comprehension has not been high >>> enough) but there are several operations which I can't figure out: > > Many of answers to your questions can be found on GitFaq, > http://git.or.cz/gitwiki/GitFaq
I should have read this earlier. I don't really understand the details, but I get the idea: make the central repository bare.
>
Show 16 quoted lines
>>> 3) Similarly, I can't use the little context diffs I can see in >>> git-gui -- I need to see side by side comparisons; I've become >>> accustomed to tkdiff. It seems like git mergetool knows how to do >>> that in some restricted circumstances, but I want to do it outside >>> the context of a merge. >> >> This I don't know, but you can get particular files from particular >> commits output with "git show <commit>:<path>", and you can likely >> wire >> something up. > > From the various graphical comparison tools, Meld has supposedly Git > support (http://meld.sourceforge.net/). Supposedly only because I > have not tested this; see > http://git.or.cz/gitwiki/InterfacesFrontendsAndTools#head-00fbd1ac45fe93dac4653cad3639b3df73d8657e >
I found no mention of git on the meld man page or in the meld mailing list.
Here's a (perhaps naive) perl script which uses "git show" and wraps around the original tkdiff. Other cvs users might find it useful, though it can surely be improved.
I'm looking for a way to embed some identifying information about version into compiled programs. I hasten to add that I am not looking to expand RCS-like tags. Unlike CVS/RCS, git provides a single value that characterizes the whole distribution, at least if everything is committed. So, something like "git log | head -1 | awk '{print $2}'" probably provides a value which I can embed into executables and libraries, tying them to a particular source configuration. I'm just curious if there's a better approach to getting the commit hash.
-- danq