top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

make git ignore the timestamp embedded in PDFs

+1 vote
272 views

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.

Here is an example:
,----
| > pdfinfo some.pdf
| Title: R Graphics Output
| Creator: R
| Producer: R 2.15.1
| CreationDate: Thu Jan 24 13:43:31 2013 "$TMPFILE"
|
| ## update the pdf metadata
| pdftk "$FILENAME" update_info "$TMPFILE" output "$TMPFILE2"
|
| ## overwrite the original pdf
| mv -f "$TMPFILE2" "$FILENAME"
|
| ## clean up
| rm -f "$TMPFILE"
| rm -f "$TMPFILE2"
| if [ -n $FILEASARG ] ; then
| cat "$FILENAME"
| fi
`----

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.

So, my question is: How can I make git *completely* ignore the embedded date in the PDF?

posted May 14, 2013 by anonymous

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

0 votes

I'm using cleaned files every now and then, but not on Linux. I have
never observed this behaviour recently.

If you 'git add' the file, does it keep its modified state? Does 'git
diff' tell a difference?

answer May 14, 2013 by anonymous
Similar Questions
+1 vote

Recently I had to write some automation scripts and I found that git reset --hard actually restores each file's permissions.

That is causing both the created and the last-modified dates of the file to get changed to the time of the git reset.

This behavior is easy to demonstrate:

echo "test" > myfile
chmod 777 myfile

git add myfile && git commit -m "Test" & the only solution I'm able to think about is actually restoring the permissions of each file to the ones git thinks they should have before doing the git reset.

Maybe I'm wrong and there is a way for doing what I want, if so, please correct me. But if there isn't, should this be implemented? Are there any reasons for not doing it?

+1 vote

Is it possible to make a git remote pack its repository on every push?

I have tried setting gc.auto to 1 on both the remote and the clients, but so far no push seems to have packed anything.

Do I need to create a push hook on the remote to make it pack?

The reason for this is that I have several git repositorier for org-mode files.

Having a history, and rollback of the history, is more important than having a good history.

The diff of each push is small, the repositories only contain one, or a handful of org-mode files, and some of the org-mode files are quite large.

The remote is git 1:2.1.4-2.1 (debian packge, git --version reports 2.1.4), running on debian 8.0 "jessie".

The clients are various GNU/linux git (whatever comes with the distro out of the box) and Win32 msysgit installations.

+1 vote

I just finished building and installing git on my Android device. After testing, I'd like to build it in such a way that I can tarball and upload/send it.

Are there any make targets that would allow me to do that or do I need to rebuild with the NO_CROSS_DIRECTORY_HARDLINKS option and install to a stage directory...like /usr/git or /usr/local/git?

+5 votes

basically, I've got clones of some expensive-to-build projects (node.js), and I have changes that I want to rebase/cherry-pick onto dev and stable branches.

I know I can push to a remote, then pull into my other, and keep the two on different branches so the builds don't get out of date. But, I think I'd like it if they all just shared the same objects, branches, etc...

Could I symlink together my .git{branches,config,hoks,logs,objects,packed-refs,refs} directories? Is this just going to kill me later?

0 votes

When I update my branch from master it pulls down several files, including some sass files. When I compile, however, gulp alerts me that I am missing .scss files.

I tested this by creating a new fresh branch and running gulp sass. This time there were no errors and I saw the missing .scss had been brought in.

Would anyone know why, on update, I am only getting some of the files from master?

...