From: Eugene Sajine <euguess@gmail.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: Alex Riesen <raa.lkml@gmail.com>,
git@vger.kernel.org, Eugene Sajine <euguess@gmail.com>
Subject: Re: ident hash usage question
Date: Tue, 20 Oct 2009 18:14:08 -0400 [thread overview]
Message-ID: <76c5b8580910201514sc44f1cag222cf8a3710c875@mail.gmail.com> (raw)
In-Reply-To: <7veioxn6ee.fsf@alter.siamese.dyndns.org>
> 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)"\" $?
>
Please, correct me if I'm mistaken and forgive me if I'm not correct
in using C++ terms.
Your solution proposes to have a version file which will carry the
info about last state the program was built from.
But as I understand in case of static linking the executable will get
only obj files from a library, which are necessary and everything
irrelevant will be thrown away by linker. In this circumstances the
program comparing two executable will not notice any differences
between let's say existing production and new development version of
the executable. In case of several libraries linked this gets even
worse. That's what their basis is for keywords expansion use.
If there is no other solution in VCS terms how to understand which
particular version of file has got linked to the executable except
keywords expansion, then I'm talking about the way of reducing the
amount of keywords expanded to a minimum - 1.
If we can agree on this, then it seems that having the content/blob
hash in the file $Id$ is enough to get any other relevant info about
the file.
At least by hash you can find the path added/modified. When the path
is on hands you can easily realize the history for the file. It seems
to me that using content hash will provide unique results enough to
make conclusions, because the probability of having two files with
same hash but different content is too low, and only scenario is to
get the same hash is to get the absolute copy of the file, but such
file existence is questionable...
OTOH, Alex was right that there are situation where this is not
working as expected from the first run:
If the file was modified its blob hash is going to change, but there
will be no entry with letter A in the log. So, if
$ git log --no-abbrev --raw --all | grep "SHA-1 A"
Returns empty string then, we should do that without "A".
As I understand this *second* run should always return:
1. only one entry if this is latest hash - one path. Goal reached.
2. two entries if there was a change afterwards - One path. Goal reached
3. three entries if rename was committed separately and then renamed
file was changed - two paths. Enough to make conclusion about the
files.
In any case the goal is to get the path as correct as possible and
then proceed with matching and other stuff.
Thanks,
Eugene
next prev parent reply other threads:[~2009-10-20 22:14 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-10-20 17:24 ident hash usage question Eugene Sajine
2009-10-20 18:16 ` Alex Riesen
2009-10-20 18:19 ` Alex Riesen
2009-10-20 18:59 ` Eugene Sajine
2009-10-20 19:19 ` Alex Riesen
2009-10-20 20:22 ` Johannes Sixt
2009-10-20 20:35 ` Alex Riesen
2009-10-20 20:30 ` Eugene Sajine
2009-10-20 20:43 ` Junio C Hamano
2009-10-20 22:14 ` Eugene Sajine [this message]
2009-10-20 22:30 ` Junio C Hamano
2009-10-20 23:49 ` Eugene Sajine
2009-10-21 5:35 ` Daniel Barkalow
2009-10-21 3:09 ` Nanako Shiraishi
2009-10-20 20:43 ` Alex Riesen
2009-10-20 22:19 ` Eugene Sajine
2009-10-21 6:25 ` Alex Riesen
2009-10-21 23:32 ` Eugene Sajine
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=76c5b8580910201514sc44f1cag222cf8a3710c875@mail.gmail.com \
--to=euguess@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=raa.lkml@gmail.com \
/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).