Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7871459
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T01:54:48+00:00 2026-06-03T01:54:48+00:00

I need to to update my source code revision keywords (@version, @date, etc) every

  • 0

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.

As you might know:

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.

Basically what I want to achieve is that my source code should look like below:

 * Git revision information:
 * 
 * @version $Revision: 1e7f611039399b32e9000ec454609a0641dde368 $
 * @author  $Author: Eugen Mihailescu <eugenmihailescux@gmail.com> $
 * @date    $Date:   Thu May 3 01:17:45 2012 +0200 $
 * 
 * $Id:  | Thu May 3 01:17:45 2012 +0200 | Eugen Mihailescu  $

Here and here you can find a full description of how you can achieve this in Git.

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.

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.

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.

I hope that I have described in detail the whole story because now I will ask:

  • is this possible in Eclipse using the EGit?
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T01:54:49+00:00Added an answer on June 3, 2026 at 1:54 am

    This commit (August 2010) commented

    Perform automatic CRLF to LF conversion during WorkingTreeIterator

    WorkingTreeIterator now optionally performs CRLF to LF conversion for text files.
    A basic framework is left in place to support enabling (or disabling) this feature based on gitattributes, and also to support the more generic smudge/clean filter system.
    As there is no gitattribute support yet in JGit this is left unimplemented, but the mightNeedCleaning(), isBinary() and filterClean() methods will provide reasonable places to plug that into in the future.

    I don’t think gitattribute is fully supported in the latest JGit releases, and the latest revision of WorkingTreeIterator has still an empty filterClean() function.

    So using JGit alone might not be enough to trigger your “filter content” driver.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an app that I need to get the source code to update
Tipically a deploy in production does not involve just a mere source code update
I need to create a VB.NET function that takes the source code of a
I have html source code which I want to filter out one or more
I need to view the tabs and spaces and CRLF in python source code
Our development uses lots of open-source code and I'm trying to figure out what
I need to update an existing SharePoint content type by adding a new field
I need to update the primary key for a record but it's also the
I need to update a record in the datastore, but instead of updated record
I need to update jquery1.3.2 to jquery1.4 (in Asp.net MVC). Please can anyone tell

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.