How to configure diff git to ignore date creation date

I use yard to create documentation for my project. Even if we think that the documentation can be generated, and therefore does not really need to be a version, we decided to do this because it makes it easier to see the effect of code changes (comments) in the actual documentation.

The problem is that every time the kernel generates documentation, it changes the date at the beginning of each file, as a result of which all files are treated as modified.

Is there a way to tell git to ignore this line to determine if the files have been modified or, alternatively, a way to configure the yard so as not to restore the file if they are identical?

thank

Update

I know I can do a script or anything that clears files, if only the date has changed. So my question is that there is a git, .ie way if I read the diff driver information or should I make a clean script.

If I were going to the cleaning path, it would be better to do this using the git hook or integrating it into the document generation.

Ultimately, I'm interested in any other way to track changes due to a certain commit in the generated document.

I really did not explain what my problem is (and why I am trying to redo what is not needed), so we go.

Once upon a time, a small code modification twisted the documentation, so I could see the effect of committing on the documentation.

Example: I use modeline for vim (a comment in the first line of the file telling vim different information)

,

#vi: my vim setting 
# Documentation of module A
module A
  .... some code

end

-

#vi : my vim setting

           ( 2 blank lines)
module A
   .... some different code
end

, A Documentation of module A. , - (, ) (, modeline ), ​​, modeline - A, vi : my vim setting.

, , , , . git, , , ( , , ).

+5
6

?

, ( git -), - , :

customtemplates/default/layout/html/footer.erb, :

  • yardoc --template-path ./customtemplates
    
  • Rakefile

    YARD::Rake::YardocTask.new do |yardoc|
        yardoc.options = ["--template-path", "./customtemplates"]
    end
    

( , Yard, customtemplates/default/layout/html/footer.erb)

<div id="footer">
     Generated by <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>.
</div>

, .

+2

, git .

- , script, git -diff, .

, - /.

+2

, :

  • git diff -G , . , , , , , , , , .
  • diff ​​ (diff -I), , , diff, git diff, .
  • meld - , git - . meld dir/ , HEAD - (Edit > Preferences > Text filters). Linux ( Ubuntu), - , MacOS X Windows ( ).
  • diffftools, git, , , .
+2

, , . , :

  • , .
  • , , .
  • , .

. fooobar.com/questions/530596/... , .

...

Git ( script Rake, , YARD), . :

# Tested with: GNU findutils 4.4.2, GNU sed 4.2.1
find doc -type f -iname \*html -exec sed -i '/id="footer"/,/\/div/ d' {} +

YARD, . .

+2

. , , IDE . .

, "" , , 15.

, , - git . . git-cleanup c:\Program Files (x86)\Git\libexec\git-core ( Windows).

, git commit git cleanup . , , , git cleanup && git commit -a -m "Commit message". .

ruby script. . git .

+1

VIM modelines, , , pre-commit ( ) pre-receive post-receive hook ( ), . , GNU sed:

sed -r '/^#[[:space:]]+vim?:/ {N; /\n[^\n]/q1}'

diff, , . , modeline YARD.

0

All Articles