Note that there are some explanatory texts on larger screens.

plurals
  1. POEclipse Git keyword expansion
    primarykey
    data
    text
    <p>I need to to update my source code revision keywords (@version, @date, etc) every time I am checking out the source to the git-hub server.</p> <p>As you might know:</p> <blockquote> <p>The main problem with this in Git is that you can’t modify a file with information about the commit after you’ve committed, because Git checksums the file first.</p> </blockquote> <p>Basically what I want to achieve is that my source code should look like below:</p> <pre><code> * Git revision information: * * @version $Revision: 1e7f611039399b32e9000ec454609a0641dde368 $ * @author $Author: Eugen Mihailescu &lt;eugenmihailescux@gmail.com&gt; $ * @date $Date: Thu May 3 01:17:45 2012 +0200 $ * * $Id: | Thu May 3 01:17:45 2012 +0200 | Eugen Mihailescu $ </code></pre> <p><a href="http://progit.org/book/ch7-2.html" rel="nofollow">Here</a> and <a href="https://github.com/turon/git-rcs-keywords" rel="nofollow">here</a> you can find a full description of how you can achieve this in Git.</p> <blockquote> <p>It turns out that you can write your own filters for doing substitutions in files on commit/checkout. These are the “clean” and “smudge” filters. In the .gitattributes file, you can set a filter for particular paths and then set up scripts that will process files just before they’re checked out (“smudge”, see Figure 7-2) and just before they’re committed.</p> </blockquote> <p>So I know how to do it with git command. I've tested, it just works! My real issue is that I would like to achieve same thing by using Eclipse IDE. In Eclipse I have Eclipse Git, which is an Eclipse Team provider based on JGit, a pure Java implementation of the Git version control system.</p> <p>In Eclipse EGit there is no such command "git checkout" but one could accomplish that by a hard reset (right-click your project then choose Team -> Reset -> Hard). Unfortunately this will not run your clean/smudge filters, in fact you will get the plain copy of your sources from the git hub without no keyword expansion.</p> <p>I hope that I have described in detail the whole story because now I will ask:</p> <ul> <li>is this possible in Eclipse using the EGit?</li> </ul>
    singulars
    1. This table or related slice is empty.
    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.
 

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