* Binary files in format-patch
@ 2008-05-05 22:55 Caio Marcelo
2008-05-05 23:01 ` Shawn O. Pearce
2008-05-06 9:19 ` Robin Rosenberg
0 siblings, 2 replies; 6+ messages in thread
From: Caio Marcelo @ 2008-05-05 22:55 UTC (permalink / raw)
To: git; +Cc: gitster
Hello,
I'm using "git format-patch" to generate messages for a code review
mailing list. It work fine except when we have binary files involved.
Their contents are not relevant for us, and doesn't help much in a
mailing list. Taking a peek at the code I've found out this:
In commit e47f306d4bf964def1a0b29e8f7cea419471dffd (short name: "git
format-patch: make --binary on by default"), we add a new restriction
on the possible options to format-patch: if you don't specify --text,
it enables --binary. But looking at today's code, we have a path that
is never taken for format-patch, in function builtin_diff (diff.c), at
lines 1423 to 1433. The fprintf doesn't ever happen, because if it's
TEXT, it dumps the contents verbatim, if it's BINARY, it encodes (to
some baseXX) the files/diff.
Wouldn't be nice to allow this code path to happen via some
--omit-binary / --no-binary option to be checked in cmd_format_patch?
(I could provide a patch for this, if you think it's a good idea).
Or should I try to solve my problem by other means (post-processing
the patches, building my own with git-diff)?
Cheers,
Caio Marcelo
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Binary files in format-patch
2008-05-05 22:55 Binary files in format-patch Caio Marcelo
@ 2008-05-05 23:01 ` Shawn O. Pearce
2008-05-05 23:10 ` Caio Marcelo
2008-05-06 9:19 ` Robin Rosenberg
1 sibling, 1 reply; 6+ messages in thread
From: Shawn O. Pearce @ 2008-05-05 23:01 UTC (permalink / raw)
To: Caio Marcelo; +Cc: git, gitster
Caio Marcelo <cmarcelo@gmail.com> wrote:
> I'm using "git format-patch" to generate messages for a code review
> mailing list. It work fine except when we have binary files involved.
> Their contents are not relevant for us, and doesn't help much in a
> mailing list. Taking a peek at the code I've found out this:
Why then are they committed in Git and being modified? If the
files aren't relevant, why are they tracked?
--
Shawn.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Binary files in format-patch
2008-05-05 23:01 ` Shawn O. Pearce
@ 2008-05-05 23:10 ` Caio Marcelo
0 siblings, 0 replies; 6+ messages in thread
From: Caio Marcelo @ 2008-05-05 23:10 UTC (permalink / raw)
To: Shawn O. Pearce; +Cc: git, gitster
> > Their contents are not relevant for us, and doesn't help much in a
> > mailing list. Taking a peek at the code I've found out this:
>
> Why then are they committed in Git and being modified? If the
> files aren't relevant, why are they tracked?
Sorry, I wasn't very clear there. The binary content is mostly icons,
that get added and updated now and then, so outside of the scope of
our code review mailing list -- but relevant to the project itself.
(The patches themselves are accessible by other means other than the
ML too, so reviewers can pull and get proper versions).
Considering that, any of the proposed solutions make more sense now? :-)
Cheers,
Caio Marcelo
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Binary files in format-patch
2008-05-05 22:55 Binary files in format-patch Caio Marcelo
2008-05-05 23:01 ` Shawn O. Pearce
@ 2008-05-06 9:19 ` Robin Rosenberg
2008-05-08 20:21 ` Caio Marcelo
1 sibling, 1 reply; 6+ messages in thread
From: Robin Rosenberg @ 2008-05-06 9:19 UTC (permalink / raw)
To: Caio Marcelo; +Cc: git, gitster
tisdagen den 6 maj 2008 00.55.06 skrev Caio Marcelo:
> Hello,
>
> I'm using "git format-patch" to generate messages for a code review
> mailing list. It work fine except when we have binary files involved.
> Their contents are not relevant for us, and doesn't help much in a
> mailing list. Taking a peek at the code I've found out this:
> In commit e47f306d4bf964def1a0b29e8f7cea419471dffd (short name: "git
> format-patch: make --binary on by default"), we add a new restriction
> on the possible options to format-patch: if you don't specify --text,
> it enables --binary. But looking at today's code, we have a path that
> is never taken for format-patch, in function builtin_diff (diff.c), at
> lines 1423 to 1433. The fprintf doesn't ever happen, because if it's
> TEXT, it dumps the contents verbatim, if it's BINARY, it encodes (to
> some baseXX) the files/diff.
>
> Wouldn't be nice to allow this code path to happen via some
> --omit-binary / --no-binary option to be checked in cmd_format_patch?
> (I could provide a patch for this, if you think it's a good idea).
Sounds reasonable. I'd say --no-binary is the right one here.
-- robin
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Binary files in format-patch
2008-05-06 9:19 ` Robin Rosenberg
@ 2008-05-08 20:21 ` Caio Marcelo
2008-05-08 20:25 ` Caio Marcelo
0 siblings, 1 reply; 6+ messages in thread
From: Caio Marcelo @ 2008-05-08 20:21 UTC (permalink / raw)
To: Robin Rosenberg; +Cc: git, gitster
> > Wouldn't be nice to allow this code path to happen via some
> > --omit-binary / --no-binary option to be checked in cmd_format_patch?
> > (I could provide a patch for this, if you think it's a good idea).
>
> Sounds reasonable. I'd say --no-binary is the right one here.
Commited a patch couple a days ago. Could anyone take a look? I've
tried to reduce the changes to a minimum.
Cheers,
Caio Marcelo
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2008-05-08 20:26 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-05-05 22:55 Binary files in format-patch Caio Marcelo
2008-05-05 23:01 ` Shawn O. Pearce
2008-05-05 23:10 ` Caio Marcelo
2008-05-06 9:19 ` Robin Rosenberg
2008-05-08 20:21 ` Caio Marcelo
2008-05-08 20:25 ` Caio Marcelo
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 NNTP newsgroup(s).