git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: make git ignore the timestamp embedded in PDFs

From
ALAndreas Leha <andreas.leha@med.uni-goettingen.de>
Date
May 18, 2013, 07:42 UTC
Message-ID
<87ppwohgyd.fsf@med.uni-goettingen.de>
In-Reply-To
<51928FE8.2050804@kdbg.org>
Hi Hannes,
thanks for taking this up and sorry for the long delay in my answer.
Johannes Sixt <j6t@kdbg.org> writes:
Show 21 quoted lines
> Am 14.05.2013 15:17, schrieb Andreas Leha:
>> Hi all,
>> 
>> how can I make git ignore the time stamp(s) in a PDF.  Two PDFs that
>> differ only in these time stamps should be considered identical.
>> ...
>> What I tried is a filter:
>> ,----[ ~/.gitconfig ]
>> | [filter "pdfresetdate"]
>> |         clean = pdfresetdate
>> `----
>> 
>> This 'works' as far as the committed pdf indeed has the date reset to my
>> default value.
>> 
>> However, when I re-checkout the files, they are marked modified by git.
>
> I'm using cleaned files every now and then, but not on Linux. I have
> never observed this behavior recently.
>
> If you 'git add' the file, does it keep its modified state? Does 'git
yes.
> diff' tell a difference?
no.
Here is a complete 'session':
,----
| > mkdir test
| > cd test
| > git init
| > echo '*.pdf filter=pdfresetdate' > .gitattributes
| > cp ~/PDF/score_table.pdf .
| > pdfinfo score_table.pdf
| Title:          (score_table)
| Author:         (andreas)
| Creator:        GPL Ghostscript 905 (ps2write)
| Producer:       GPL Ghostscript 9.05
| CreationDate:   Fri Feb  8 15:44:47 2013
| ModDate:        Fri Feb  8 15:44:47 2013
| Tagged:         no
| Pages:          1
| Encrypted:      no
| Page size:      595 x 842 pts (A4)
| File size:      36989 bytes
| Optimized:      no
| PDF version:    1.4
| > git add score_table.pdf
| > pdfinfo score_table.pdf
| Title:          (score_table)
| Author:         (andreas)
| Creator:        GPL Ghostscript 905 (ps2write)
| Producer:       GPL Ghostscript 9.05
| CreationDate:   Fri Feb  8 15:44:47 2013
| ModDate:        Fri Feb  8 15:44:47 2013
| Tagged:         no
| Pages:          1
| Encrypted:      no
| Page size:      595 x 842 pts (A4)
| File size:      36989 bytes
| Optimized:      no
| PDF version:    1.4
| > git commit -m "test"
| > pdfinfo score_table.pdf
| Title:          (score_table)
| Author:         (andreas)
| Creator:        GPL Ghostscript 905 (ps2write)
| Producer:       GPL Ghostscript 9.05
| CreationDate:   Fri Feb  8 15:44:47 2013
| ModDate:        Fri Feb  8 15:44:47 2013
| Tagged:         no
| Pages:          1
| Encrypted:      no
| Page size:      595 x 842 pts (A4)
| File size:      36989 bytes
| Optimized:      no
| PDF version:    1.4
| > rm score_table.pdf
| > git checkout  score_table.pdf  
| > git status
| # On branch master
| # Changes not staged for commit:
| #   (use "git add <file>..." to update what will be committed)
| #   (use "git checkout -- <file>..." to discard changes in working directory)
| #
| #       modified:   score_table.pdf
| #
| # Untracked files:
| #   (use "git add <file>..." to include in what will be committed)
| #
| #       .gitattributes
| no changes added to commit (use "git add" and/or "git commit -a")
| > pdfinfo score_table.pdf 
| Title:          (score_table)
| Author:         (andreas)
| Creator:        GPL Ghostscript 905 (ps2write)
| Producer:       GPL Ghostscript 9.05
| CreationDate:   Mon Jan  1 07:26:19 1979
| ModDate:        Mon Jan  1 07:26:19 1979
| Tagged:         no
| Pages:          1
| Encrypted:      no
| Page size:      595 x 842 pts (A4)
| File size:      37126 bytes
| Optimized:      no
| PDF version:    1.4
| > git add score_table.pdf
| > git status
| # On branch master
| # Changes to be committed:
| #   (use "git reset HEAD <file>..." to unstage)
| #
| #       modified:   score_table.pdf
| #
| # Untracked files:
| #   (use "git add <file>..." to include in what will be committed)
| #
| #       .gitattributes
| > git diff score_table.pdf
| > 
`----

Regards, Andreas

Previous: Johannes SixtNext: Johannes Sixt
Message 3 of 5 in “make git ignore the timestamp embedded in PDFs”
  1. Andreas LehaMay 14, 2013
  2. Johannes SixtMay 14, 2013
  3. Andreas LehaMay 18, 2013
  4. Johannes SixtMay 18, 2013
  5. Andreas LehaMay 18, 2013

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.