From mboxrd@z Thu Jan 1 00:00:00 1970 From: Junio C Hamano Subject: Re: git with custom diff for commits Date: Tue, 18 Dec 2007 01:25:37 -0800 Message-ID: <7vodco1him.fsf@gitster.siamese.dyndns.org> References: <60687a7d0712171456p14328817y5aa229f0df23c02f@mail.gmail.com> <7vbq8o6gxw.fsf@gitster.siamese.dyndns.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Johannes Schindelin , Gerald Gutierrez , git@vger.kernel.org To: Matthieu Moy X-From: git-owner@vger.kernel.org Tue Dec 18 10:26:20 2007 Return-path: Envelope-to: gcvg-git-2@gmane.org Received: from vger.kernel.org ([209.132.176.167]) by lo.gmane.org with esmtp (Exim 4.50) id 1J4YiO-0007IY-P9 for gcvg-git-2@gmane.org; Tue, 18 Dec 2007 10:26:17 +0100 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752170AbXLRJZx (ORCPT ); Tue, 18 Dec 2007 04:25:53 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752134AbXLRJZx (ORCPT ); Tue, 18 Dec 2007 04:25:53 -0500 Received: from a-sasl-quonix.sasl.smtp.pobox.com ([208.72.237.25]:56117 "EHLO sasl.smtp.pobox.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752165AbXLRJZw (ORCPT ); Tue, 18 Dec 2007 04:25:52 -0500 Received: from a-sasl-quonix (localhost [127.0.0.1]) by a-sasl-quonix.pobox.com (Postfix) with ESMTP id 41A54513C; Tue, 18 Dec 2007 04:25:46 -0500 (EST) Received: from pobox.com (ip68-225-240-77.oc.oc.cox.net [68.225.240.77]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by a-sasl-quonix.pobox.com (Postfix) with ESMTP id 6FDCB513B; Tue, 18 Dec 2007 04:25:40 -0500 (EST) In-Reply-To: (Matthieu Moy's message of "Tue, 18 Dec 2007 09:57:48 +0100") User-Agent: Gnus/5.110006 (No Gnus v0.6) Emacs/21.4 (gnu/linux) Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Archived-At: Matthieu Moy writes: > Junio C Hamano 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.