On Wed, 1 Jul 2015 06:37:12 -0700 (PDT)
Konrád Lőrinczi <klorin...@gmail.com> wrote:

> I have two branches and the only difference between them is the cvs
> $id$, which is expanded in one branch and not expanded in the other. 
> 
> Is there a way to show git diff as unchanged? 
> Also should not show conflict in case of git merge. 

Two approaches:

1) Simply remove it from the files in both branches, as Magnus
   suggested.

   Another idea is to modify files only in the branch in which
   the tokens are expanded -- simply modify them back into "token"
   form to read just $Id$.

   After that change, the files will be byte-to-byte identical.

2) If you actually need this tokens expanded for real (that is, to
   contain some up-to-date information, read up on clean/smudge
   filters (use `git help attributes`).

   Basically, you'll need a pair of programs one of which would
   expand those tokens in the data it reads from its stdin
   and write the result to its stdout, and another one would do
   the reverse -- turning the $Id: blah blah$ back to just $Id$.
   This way you have files with expanded tokens in your work tree
   and files with normalized tokens in the repository.  Git will also
   take care to apply clean filters when you do plain `git diff` --
   thus comparing the file in the work tree to its version in the
   repository.

I'd say, usage of VCS keywords these days is questionable.
First, knowing which revision the file came from is only supposeldy
useful for non-compiled code (like programs written in Tcl, Perl, Python
etc), and for cases files could be somehow updated / checked out by the
user individually.
Second, given just the file without any expanded VCS keywords in it,
you still are able to guess which commit(s) it could have came from --
quick googling yields [1, 2] as the top two links.

1. http://stackoverflow.com/a/223890/720999
2. http://blog.endpoint.com/2014/11/finding-specific-git-commit-at-point-in.html

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to