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

Re: ident hash usage question

From
Junio C Hamano <gitster@pobox.com>
Date
Oct 20, 2009, 20:43 UTC
Message-ID
<7veioxn6ee.fsf@alter.siamese.dyndns.org>
In-Reply-To
<76c5b8580910201330r45cf625k3a41b5b9e24b3e01@mail.gmail.com>
Eugene Sajine <euguess@gmail.com> writes:
Show 9 quoted lines
> One of my friends said that git is not working for their development
> model... C++ development with static linking across the board, where
> they need to see exactly which version of the file has got to the
> executable. Roughly, they are using CVS' keywords and revision numbers
> and a script wich matches them between two versions of the
> executables.
>
> I've got curious if Git can support it and how it can be done with
> minimal changes to workflow.

If the project is already arranged to be compiled with decent automation, I do not think you need any change to the workflow.

You would have a version.cc file with
	static char program_version[] = "My Program " VERSION_STRING;

in it, and teach the build procedure how to compile and link this file. Something like:

    version.o: version.cc
    	$(CXX) -o $@ -DVERSION_STRING=\""$(git describe HEAD)"\" $?
Previous: Eugene SajineNext: Eugene Sajine
Message 9 of 18 in “ident hash usage question”
  1. Eugene SajineOct 20, 2009
  2. Alex RiesenOct 20, 2009
  3. Alex RiesenOct 20, 2009
  4. Eugene SajineOct 20, 2009
  5. Alex RiesenOct 20, 2009
  6. Johannes SixtOct 20, 2009
  7. Alex RiesenOct 20, 2009
  8. Eugene SajineOct 20, 2009
  9. Junio C HamanoOct 20, 2009
  10. Eugene SajineOct 20, 2009
  11. Junio C HamanoOct 20, 2009
  12. Eugene SajineOct 20, 2009
  13. Daniel BarkalowOct 21, 2009
  14. Nanako ShiraishiOct 21, 2009
  15. Alex RiesenOct 20, 2009
  16. Eugene SajineOct 20, 2009
  17. Alex RiesenOct 21, 2009
  18. Eugene SajineOct 21, 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.