All of lore.kernel.org
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Matthieu Moy <Matthieu.Moy@imag.fr>
Cc: Johannes Schindelin <Johannes.Schindelin@gmx.de>,
	Gerald Gutierrez <ggmlfs@gmail.com>,
	git@vger.kernel.org
Subject: Re: git with custom diff for commits
Date: Tue, 18 Dec 2007 01:25:37 -0800	[thread overview]
Message-ID: <7vodco1him.fsf@gitster.siamese.dyndns.org> (raw)
In-Reply-To: <vpqk5ncz8fn.fsf@bauges.imag.fr> (Matthieu Moy's message of "Tue, 18 Dec 2007 09:57:48 +0100")

Matthieu Moy <Matthieu.Moy@imag.fr> writes:

> Junio C Hamano <gitster@pobox.com> writes:
> ...
>> I wouldn't do filters for something like that.  Can you guarantee that
>> the output from corresopnding smudge filter will load cleanly back to
>> the mysql database?
>
> The original poster said the date was an SQL comment, so, it should be
> safe to strip it. That said, precommit hook is probably a good or
> better solution. At least, if you're not sure you didn't make a
> mistake writting it, you'll notice either a good commit or no commit
> at all. With filters, you might well notice you corrupted the commit
> too late :-(.

Yeah.  After writing the message you are responding to, I realized that
I already do something like that to manage html/man branches that are
autogenerated, and it is exactly the same situation as Gerald is in.

The autogeneration of documentation and updating of html/man branches is
controlled by dodoc.sh script in 'todo' branch, installed as post-update
hook in my public repository.  It builds the documentation in a checkout
of 'master' branch, installs the result into another checkout of 'html'
and 'man' branches, and commits.

The twist is in the "install" step (this is different from my suggestion
of preventing the commit in pre-commit hook).  When the newly generated
documentation files are different from the previously generated ones
only by datestamp, they are not installed into 'html'/'man' checkouts,
and such a change is not included in the commits.

So my updated suggestion would be:

 - Keep a checkout of that mysql dump;

 - Make the dump procedure to dump to that checkout area;

 - Run "git diff HEAD", perhaps with the external diff that filters out
   the cruft as suggested in the thread, and run "git checkout $path"
   for paths that had only meaningless changes;

 - Run "git commit" if the above step did not nuke all changes.

  reply	other threads:[~2007-12-18  9:26 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 [this message]
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
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=7vodco1him.fsf@gitster.siamese.dyndns.org \
    --to=gitster@pobox.com \
    --cc=Johannes.Schindelin@gmx.de \
    --cc=Matthieu.Moy@imag.fr \
    --cc=ggmlfs@gmail.com \
    --cc=git@vger.kernel.org \
    /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.