git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* git-gui: textconv not used on unstaged files
@ 2012-10-24 18:33 Peter Oberndorfer
  2012-11-26 20:28 ` Peter Oberndorfer
  0 siblings, 1 reply; 4+ messages in thread
From: Peter Oberndorfer @ 2012-10-24 18:33 UTC (permalink / raw)
  To: git

Hi,

i am using a textconv filter to display .doc files as plain text.
It seems git gui does not use this textconv filter for displaying new 
unstaged files
(other files? = _O)
It seems diff.tcl start_show_diff calls show_other_diff because of this.
This manually loads the file and does not care about textconv filters.

Is this manual loading really necessary or can't we just ask git?
If it is can it be modified to use the textconv filter?

Thanks,
Greetings Peter

.gitattributes:
*.doc    diff=astextplain

gitconfig:
[diff "astextplain"]
     textconv = astextplain

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

* Re: git-gui: textconv not used on unstaged files
  2012-10-24 18:33 git-gui: textconv not used on unstaged files Peter Oberndorfer
@ 2012-11-26 20:28 ` Peter Oberndorfer
  2012-11-26 20:54   ` Junio C Hamano
  0 siblings, 1 reply; 4+ messages in thread
From: Peter Oberndorfer @ 2012-11-26 20:28 UTC (permalink / raw)
  To: git

On 2012-10-24 20:33, Peter Oberndorfer wrote:
> Hi,
>
> i am using a textconv filter to display .doc files as plain text.
> It seems git gui does not use this textconv filter for displaying new unstaged files
> (other files? = _O)
> It seems diff.tcl start_show_diff calls show_other_diff because of this.
> This manually loads the file and does not care about textconv filters.
>
> Is this manual loading really necessary or can't we just ask git?
> If it is can it be modified to use the textconv filter?
>
Does anybody have a idea which git command
would output the diff of a untracked file against /dev/null?
So I can show the textconved version of the file in git gui.
(and not reinvent the code to apply textconv already in git)

Thanks,
Greetings Peter

>
> .gitattributes:
> *.doc    diff=astextplain
>
> gitconfig:
> [diff "astextplain"]
>     textconv = astextplain

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

* Re: git-gui: textconv not used on unstaged files
  2012-11-26 20:28 ` Peter Oberndorfer
@ 2012-11-26 20:54   ` Junio C Hamano
  2012-11-27 20:37     ` Peter Oberndorfer
  0 siblings, 1 reply; 4+ messages in thread
From: Junio C Hamano @ 2012-11-26 20:54 UTC (permalink / raw)
  To: Peter Oberndorfer; +Cc: git

Peter Oberndorfer <kumbayo84@arcor.de> writes:

> Does anybody have a idea which git command would output the diff
> of a untracked file against /dev/null?

The "--no-index" option is meant as a bolt-on to let you use various
features of "git diff" that is missing from other people's "diff" in
a context where git does not know anything about that file.  It
should be usable even outside a git repository.

    $ git diff --no-index /dev/null new-file.txt

I do not know offhand (and didn't bother to check) if textconv
applies, though.  It does need access to a git repository as it
reads from the $GIT_DIR/config to learn what to do.

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

* Re: git-gui: textconv not used on unstaged files
  2012-11-26 20:54   ` Junio C Hamano
@ 2012-11-27 20:37     ` Peter Oberndorfer
  0 siblings, 0 replies; 4+ messages in thread
From: Peter Oberndorfer @ 2012-11-27 20:37 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git

On 2012-11-26 21:54, Junio C Hamano wrote:
> Peter Oberndorfer <kumbayo84@arcor.de> writes:
>
>> Does anybody have a idea which git command would output the diff
>> of a untracked file against /dev/null?
> The "--no-index" option is meant as a bolt-on to let you use various
> features of "git diff" that is missing from other people's "diff" in
> a context where git does not know anything about that file.  It
> should be usable even outside a git repository.
>
>     $ git diff --no-index /dev/null new-file.txt
>
> I do not know offhand (and didn't bother to check) if textconv
> applies, though.  It does need access to a git repository as it
> reads from the $GIT_DIR/config to learn what to do.
Hi,

this seems to work when adding the --textconv option.
I will try to see if I can modify git gui to use this command
when clicking a unstaged file.

Thanks,
Greetings Peter

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

end of thread, other threads:[~2012-11-27 20:37 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-10-24 18:33 git-gui: textconv not used on unstaged files Peter Oberndorfer
2012-11-26 20:28 ` Peter Oberndorfer
2012-11-26 20:54   ` Junio C Hamano
2012-11-27 20:37     ` Peter Oberndorfer

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).