From mboxrd@z Thu Jan 1 00:00:00 1970 From: Kalle Olavi Niemitalo Subject: reflogs generated by git-cvsimport Date: Fri, 31 Jul 2009 20:42:26 +0300 Message-ID: <87fxccagvx.fsf@Astalo.kon.iki.fi> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii To: git@vger.kernel.org X-From: git-owner@vger.kernel.org Fri Jul 31 19:52:50 2009 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 1MWwHe-0007oE-GH for gcvg-git-2@gmane.org; Fri, 31 Jul 2009 19:52:46 +0200 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751820AbZGaRwh (ORCPT ); Fri, 31 Jul 2009 13:52:37 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751904AbZGaRwh (ORCPT ); Fri, 31 Jul 2009 13:52:37 -0400 Received: from sypressi.dnainternet.net ([83.102.40.135]:49327 "EHLO sypressi.dnainternet.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751556AbZGaRwg (ORCPT ); Fri, 31 Jul 2009 13:52:36 -0400 X-Greylist: delayed 608 seconds by postgrey-1.27 at vger.kernel.org; Fri, 31 Jul 2009 13:52:35 EDT Received: from localhost (localhost [127.0.0.1]) by sypressi.dnainternet.net (Postfix) with ESMTP id A2FFAA5D05 for ; Fri, 31 Jul 2009 20:38:57 +0300 (EEST) X-Virus-Scanned: Debian amavisd-new at !change-mydomain-variable!.example.com X-Spam-Flag: NO X-Spam-Score: -2.285 X-Spam-Level: X-Spam-Status: No, score=-2.285 tagged_above=-9999 required=7 tests=[AWL=0.027, BAYES_00=-2.312] Received: from sypressi.dnainternet.net ([83.102.40.135]) by localhost (sypressi.dnainternet.net [127.0.0.1]) (amavisd-new, port 10041) with ESMTP id V1V9MVmI1oc1 for ; Fri, 31 Jul 2009 20:38:57 +0300 (EEST) Received: from luumupuu.dnainternet.net (luumupuu.dnainternet.net [83.102.40.213]) by sypressi.dnainternet.net (Postfix) with ESMTP id 6AA1FA5D04 for ; Fri, 31 Jul 2009 20:38:57 +0300 (EEST) Received: from Astalo.kon.iki.fi (85-23-32-64-Rajakyla-TR1.suomi.net [85.23.32.64]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by luumupuu.dnainternet.net (Postfix) with ESMTPS id 1A97D2BAF0 for ; Fri, 31 Jul 2009 20:42:27 +0300 (EEST) Received: from Kalle by Astalo.kon.iki.fi with local (Exim 4.69) (envelope-from ) id 1MWw7e-00063C-Oe; Fri, 31 Jul 2009 20:42:26 +0300 User-Agent: Gnus/5.110007 (No Gnus v0.7) Emacs/23.0.51 (gnu/linux) X-Accept-Language: fi;q=1.0, en;q=0.9, sv;q=0.5, de;q=0.1 Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Archived-At: When I run git cvsimport incrementally, it generates a reflog entry for each CVS commit, because it runs git-update-ref after each git-commit-tree. I think it'd be nicer to make just one reflog entry at the end, when all CVS patchsets have been imported. I could then use git log cvs/master@{1}..cvs/master to see all the commits on master that were imported in the latest run. If git-cvsimport.perl kept the commit IDs in Perl variables only, and then updated the refs once at the end, I'd get the reflogs I prefer. However, if the script were interrupted in the middle, it would then leave the refs unchanged, and the next cvsimport run would have to download the same commits again. I suppose that could be fixed with some $SIG{'INT'} handler. But then how about the git repack -a -d that git-cvsimport.perl runs every 1024 commits: could that lose some commits that have been imported from CVS but not yet saved in any ref? Would it be better to create temporary refs/cvsimport/* and then finally update the real refs based on those? There's also another problem with the reflogs. The current version of git-cvsimport sets GIT_COMMITTER_DATE and related variables for git-commit-tree, and then leaves them set for git-update-ref. So git-update-ref saves the author and date of the CVS commit into the reflog. It would be better to save the name of the person who is running git cvsimport, and the local time. That one I've already fixed in my local version, but I'm not really happy with how the code turned out.