Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>"at your repository"? at your repository <em>directly</em>?<br> That would be call "<strong>keyword expansion</strong>" and that is not recommended (as discussed in this <a href="https://stackoverflow.com/questions/1122485/vss-to-clearcase-transition-appending-comments/1122651#1122651">SO question</a>)</p> <p>Putting meta-data (revision number) into data stored into a repository can <a href="https://stackoverflow.com/questions/645008/what-are-the-basic-clearcase-concepts-every-developer-should-know/645424#645424">lead to merge issues</a>.</p> <p>What you see in SO pages are the result of a deployment process which takes the meta-data from SVN (the revision) and puts it into the generated HTML pages.</p> <p><a href="http://git.or.cz/gitwiki/GitFaq#Doesgithavekeywordexpansion.3F" rel="nofollow noreferrer">GitFaq</a> does not recommend it either.<br> The equivalent to a SVN revision number integrated into files deployed on a server would be using <a href="https://stackoverflow.com/questions/677436/how-to-get-the-git-commit-count"><strong>git describe</strong></a>, in order to get some sort of a "commit count" to be displayed during deployment step.</p> <p>But recording it directly in the repository would mean keyword expansion, <em>and</em> keyword <em>un</em>expansion.</p> <hr> <p>To illustrate that, let's check out what Linus said at the time of the original discussion on this topic (April 2007):</p> <blockquote> <p>Adding expansion is not just "harder". It's basically impossible to do with any kind of performance.<br> Think "<code>git checkout newbranch</code>".<br> And think what we do about files (and whole subdirectories!) that haven't even changed. And finally, think about how important that optimization is in an SCM like git that supports branches.</p> <p>[the] fundamental problems that keyword expansion has (ie switching branches is basically impossible to do without checking out <em>every_single_file</em> with the "keyword" attribute set. There are others).</p> <p>Now, unexpansion is trivial to do (it really <em>is</em> the same as the "CRLF->LF" translation: that's technically really just an "unexpansion" too). And it should work. </p> <p>The way this does unexpansion also breaks "git diff" in that it basically always makes diff <em>ignore</em> the keywords. In other words, when you do</p> </blockquote> <pre><code>git diff A..B </code></pre> <blockquote> <p>and send the diff to somebody else, they'll never see any keywords at all! </p> <p>Now, that obviously fulfills my requirement that the diff be empty if A and B are the same, so you should expect me to be happy.<br> But I'm not happy, because if the other person also is using git, HE CANNOT EVEN APPLY THE DIFF!<br> Even if he's at "A", and thus gets a diff that is supposed to apply <em>exactly</em>, he'll get rejects if there were other changes around the unexpanded keyword (which <em>he</em> will have expanded in his working tree, of course!)</p> <p>See? Keywords simply <em>cannot</em> work. They're broken. Either you can ignore them (and not show them in diffs), in which case the diff is broken, or you can not ignore them (and show them in diffs) in which case the diff is <em>also</em> broken, just differently.</p> <p>The only sane and workable case is to not have them at all. Any keyword expansion will <em>always</em> result in problems. You simply cannot do it right. </p> </blockquote>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload