All of lore.kernel.org
 help / color / mirror / Atom feed
From: Matthieu Moy <Matthieu.Moy@imag.fr>
To: "Gerald Gutierrez" <ggmlfs@gmail.com>
Cc: "'Junio C Hamano'" <gitster@pobox.com>,
	"'Johannes Schindelin'" <Johannes.Schindelin@gmx.de>,
	<git@vger.kernel.org>
Subject: Re: git with custom diff for commits
Date: Wed, 19 Dec 2007 10:13:45 +0100	[thread overview]
Message-ID: <vpqodcnvygm.fsf@bauges.imag.fr> (raw)
In-Reply-To: <000d01c841c5$386f7350$762a14ac@na.acco.com> (Gerald Gutierrez's message of "Tue\, 18 Dec 2007 14\:27\:38 -0800")

"Gerald Gutierrez" <ggmlfs@gmail.com> writes:

> if (user_redefined_changed)
>   if (user_defn_of_changed(work, head)) commit(work);
> else
>   if (builtin_changed(work, head)) commit(work);

That would lead to even less intuitive semantics.

Suppose your working tree has two changes, like

--- a/file
+++ b/file
@@ ... @@
-old ignored line
+new ignored line
@@ ... @@
-this is relevant
+change

What would git be supposed to do if you ignore anything containing
"ignored"?

If git commits, it will commit both changes. People checking-out the
new revision will get "new ignored line" in the file. So, a portion of
the diff that you wanted to ignore has actually gone into the
repository. IOW, whether "new ignored line" would go into the
repository depends on the presence of another unrelated change.

Perhaps you would have expected this, but I wouldn't, and I bet many
other users wouldn't either. And usually, when you can't have people
agree on a common reasonable semantics, the answer is "don't put it in
git, let people script the semantics they want".


Take another example : I use an external diff tool to work with
OpenDocument files. It converts them into text, and calls "git diff"
on them. My diff driver therefore ignores formatting changes. If I
made only content changes, I get no change with this diff driver.
Still, if I commit, I expect git to record my new formatting.

-- 
Matthieu

  parent reply	other threads:[~2007-12-19  9:17 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-12-17 22:56 git with custom diff for commits Gerald Gutierrez
2007-12-17 23:01 ` Johannes Schindelin
2007-12-17 23:08   ` Matthieu Moy
2007-12-17 23:11     ` Johannes Schindelin
2007-12-17 23:26       ` Junio C Hamano
2007-12-18  8:57         ` Matthieu Moy
2007-12-18  9:25           ` Junio C Hamano
2007-12-18 20:35             ` Gerald Gutierrez
2007-12-18 20:40               ` Junio C Hamano
2007-12-18 20:48                 ` Gerald Gutierrez
2007-12-18 21:27                   ` Johannes Schindelin
2007-12-18 21:51                     ` Gerald Gutierrez
2007-12-18 22:00                       ` Johannes Schindelin
2007-12-18 21:38                   ` Junio C Hamano
2007-12-18 21:51                   ` Matthieu Moy
2007-12-18 22:27                     ` Gerald Gutierrez
2007-12-18 22:48                       ` Johannes Schindelin
2007-12-18 23:52                         ` Martin Langhoff
2007-12-19  9:01                         ` Matthieu Moy
2007-12-19 12:09                           ` Johannes Schindelin
2007-12-19 12:13                             ` Matthieu Moy
2007-12-19  9:13                       ` Matthieu Moy [this message]
2007-12-18 22:29                     ` Gerald Gutierrez
2007-12-17 23:27       ` Gerald Gutierrez

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=vpqodcnvygm.fsf@bauges.imag.fr \
    --to=matthieu.moy@imag.fr \
    --cc=Johannes.Schindelin@gmx.de \
    --cc=ggmlfs@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.