Skip to content
This repository has been archived by the owner on Nov 9, 2017. It is now read-only.

Git Blame - file.dot is not a Word Document #367

Closed
Choonster opened this issue Jul 19, 2015 · 3 comments
Closed

Git Blame - file.dot is not a Word Document #367

Choonster opened this issue Jul 19, 2015 · 3 comments

Comments

@Choonster
Copy link

Git Version: 1.9.5.msysgit.0
OS: MINGW32_NT-6.2 (Git Bash on Windows 8.1 with MS Word 2013 installed)

Steps to reproduce:

git clone https://github.com/torvalds/linux.git
cd linux
git blame Documentation/blockdev/drbd/conn-states-8.dot

Output from git blame:

Documentation/blockdev/drbd/conn-states-8.dot is not a Word Document.
b411b363 (Philipp Reisner 2009-09-25 16:07:19 -0700  1) digraph conn_states {
b411b363 (Philipp Reisner 2009-09-25 16:07:19 -0700  2)         StandAllone  ->
b411b363 (Philipp Reisner 2009-09-25 16:07:19 -0700  3)         WFConnection ->
b411b363 (Philipp Reisner 2009-09-25 16:07:19 -0700  4)         WFConnection ->
b411b363 (Philipp Reisner 2009-09-25 16:07:19 -0700  5)         WFReportParams -
b411b363 (Philipp Reisner 2009-09-25 16:07:19 -0700  6)         WFReportParams -
b411b363 (Philipp Reisner 2009-09-25 16:07:19 -0700  7)         WFReportParams -
b411b363 (Philipp Reisner 2009-09-25 16:07:19 -0700  8)         WFReportParams -
b411b363 (Philipp Reisner 2009-09-25 16:07:19 -0700  9)         WFBitMapS -> Syn
b411b363 (Philipp Reisner 2009-09-25 16:07:19 -0700 10)         WFBitMapT -> Syn
b411b363 (Philipp Reisner 2009-09-25 16:07:19 -0700 11)         SyncSource -> Co
b411b363 (Philipp Reisner 2009-09-25 16:07:19 -0700 12)         SyncTarget -> Co
b411b363 (Philipp Reisner 2009-09-25 16:07:19 -0700 13)         SyncSource -> Pa
b411b363 (Philipp Reisner 2009-09-25 16:07:19 -0700 14)         SyncTarget -> Pa
b411b363 (Philipp Reisner 2009-09-25 16:07:19 -0700 15)         PausedSyncS -> S
b411b363 (Philipp Reisner 2009-09-25 16:07:19 -0700 16)         PausedSyncT -> S
b411b363 (Philipp Reisner 2009-09-25 16:07:19 -0700 17)         Connected   -> W
b411b363 (Philipp Reisner 2009-09-25 16:07:19 -0700 18) }

It seems like Git is trying and failing to open the .dot file with Word, but opening it with Word directly works without issue.

@dscho
Copy link
Member

dscho commented Jul 22, 2015

It seems like Git is trying and failing to open the .dot file with Word, but opening it with Word directly works without issue.

Umm. What you have there is not a Word document at all. It is a GraphViz file.

Our global gitattributes file says that the Word helper should be used to visualize the file contents, hence the warning (which you could silence by creating a file .git/info/attributes inside your project's top-level directory with the line *.dot -astextplain).

But since Git falls back to treating the .dot file as plain text, I do not see that there is a real problem. After all, the correct output is shown, wouldn't you agree?

Please also note that we do appreciate it everytime a user asks questions on the mailing list instead of opening a ticket in our bug tracker where we really would like only reports of problems caused by the software.

@dscho dscho closed this as completed Jul 22, 2015
@Choonster
Copy link
Author

I thought this was an issue/bug with Git or Git for Windows, hence the ticket rather than the question.

I realise that it's a GraphViz file rather than a Word document, but I wasn't aware that the error message was coming from Git's Word helper.

I encountered this behaviour through a third-party tool that reads the output of git blame and treats the message on stderr as an error. I'm not sure what the correct behaviour would be here, since the Word helper expects .dot files to be Word documents and warns when they're not and third-party tools usually expect messages on stderr to be errors.

Adding an attributes file with *.dot diff=-astextplain did silence the warning, though.

@dscho
Copy link
Member

dscho commented Aug 20, 2015

Adding an attributes file with *.dot diff=-astextplain did silence the warning

That is the correct solution. Git for Windows expects .dot files to be Word files by default, and you overrode the default. 👍

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants