public inbox for git@vger.kernel.org 
 help / color / mirror / Atom feed
* How can I get full filenames from Git difftool (for Microsoft Word “Compare Documents” feature)?
       [not found] <b507cb050912132222x7e1daa9cw73b13f3db0ee22c6@mail.gmail.com>
@ 2009-12-14  6:25 ` Doug Ireton
  2009-12-14  7:55   ` Matthieu Moy
  2009-12-14 13:11   ` Jeff Epler
  0 siblings, 2 replies; 3+ messages in thread
From: Doug Ireton @ 2009-12-14  6:25 UTC (permalink / raw)
  To: git

I am using the latest version of Git (1.6.6) on a Mac. My wife wants
to use Git to manage her fiction writing as long as she can still use
Microsoft Word 2008 (Mac). Instead of pushing her into saving
everything as plain text, I would like to use Git Difftool to pass the
files to Word and use Word's Compare Documents feature. She wouldn't
be able to use Git Diff since Word docs are binary files but she could
still use Git Difftool.

I have written an Applescript which takes two filenames in this
format: /Users/foo/Documents/my_novel.docx and opens Word to do the
file comparison. However, Git Difftool seems to only pass the bare
filenames (e.g. my_novel.docx) as parameters.

Is there anyway to get the full filenames from Git Difftool?

Thanks,

Doug Ireton

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: How can I get full filenames from Git difftool (for Microsoft Word “Compare Documents” feature)?
  2009-12-14  6:25 ` How can I get full filenames from Git difftool (for Microsoft Word “Compare Documents” feature)? Doug Ireton
@ 2009-12-14  7:55   ` Matthieu Moy
  2009-12-14 13:11   ` Jeff Epler
  1 sibling, 0 replies; 3+ messages in thread
From: Matthieu Moy @ 2009-12-14  7:55 UTC (permalink / raw)
  To: Doug Ireton; +Cc: git

Doug Ireton <dougireton@gmail•com> writes:

> I am using the latest version of Git (1.6.6) on a Mac. My wife wants
> to use Git to manage her fiction writing as long as she can still use
> Microsoft Word 2008 (Mac). Instead of pushing her into saving
> everything as plain text, I would like to use Git Difftool to pass the
> files to Word and use Word's Compare Documents feature. She wouldn't
> be able to use Git Diff since Word docs are binary files but she could
> still use Git Difftool.

If you're interested in diff-ing the _text_ itself, you can use the
textconv filter of Git, together with antiword (or catdoc, which does
the same thing, but I think antiword works better).

See this:

http://git.or.cz/gitwiki/GitTips#HowtousegittotrackOpenDocument.28OpenOffice.2CKoffice.29files.3F

and adapt by replacing "OpenOffice" with MS Word, and odt2txt with
antiword.

-- 
Matthieu Moy
http://www-verimag.imag.fr/~moy/

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: How can I get full filenames from Git difftool (for Microsoft Word “Compare Documents” feature)?
  2009-12-14  6:25 ` How can I get full filenames from Git difftool (for Microsoft Word “Compare Documents” feature)? Doug Ireton
  2009-12-14  7:55   ` Matthieu Moy
@ 2009-12-14 13:11   ` Jeff Epler
  1 sibling, 0 replies; 3+ messages in thread
From: Jeff Epler @ 2009-12-14 13:11 UTC (permalink / raw)
  To: Doug Ireton; +Cc: git

In the bash shell, you can convert a relative path to absolute by prepending
the directory name:
    mkabs () {
        case "$1" in
        /*) echo "$1" ;;
        *)  echo "$(pwd)/$1" ;;
        esac
    }

Using it at the shell prompt:
    $ mkabs example
    /home/jepler/example
    $ ls -l $(mkabs example)
    -rw-r--r-- 1 jepler jepler 0 2009-12-14 07:08 /home/jepler/example

If mac has a gnu-like readlink(1), then use 'readlink -f' instead of the
mkabs shell function:
    $ readlink -f example
    /home/jepler/example

You should be able to write a shell script which does the conversion
from relative to absolute using one of these patterns, and then invokes
the applescript.

It may turn out that there's a way to convert a path from relative to
absolute in applescript as well, but I wouldn't know it.

Jeff

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2009-12-14 13:11 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <b507cb050912132222x7e1daa9cw73b13f3db0ee22c6@mail.gmail.com>
2009-12-14  6:25 ` How can I get full filenames from Git difftool (for Microsoft Word “Compare Documents” feature)? Doug Ireton
2009-12-14  7:55   ` Matthieu Moy
2009-12-14 13:11   ` Jeff Epler

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox