From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jakub Narebski Subject: Re: Making GIT XML aware? Date: Tue, 01 Sep 2009 07:25:54 -0700 (PDT) Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: git@vger.kernel.org To: david.hagood@gmail.com X-From: git-owner@vger.kernel.org Tue Sep 01 16:26:06 2009 Return-path: Envelope-to: gcvg-git-2@lo.gmane.org Received: from vger.kernel.org ([209.132.176.167]) by lo.gmane.org with esmtp (Exim 4.50) id 1MiUJC-00080t-3H for gcvg-git-2@lo.gmane.org; Tue, 01 Sep 2009 16:26:06 +0200 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754950AbZIAOZz (ORCPT ); Tue, 1 Sep 2009 10:25:55 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1754946AbZIAOZy (ORCPT ); Tue, 1 Sep 2009 10:25:54 -0400 Received: from mail-fx0-f217.google.com ([209.85.220.217]:65042 "EHLO mail-fx0-f217.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754921AbZIAOZy (ORCPT ); Tue, 1 Sep 2009 10:25:54 -0400 Received: by fxm17 with SMTP id 17so46977fxm.37 for ; Tue, 01 Sep 2009 07:25:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:received:received :x-authentication-warning:to:cc:subject:references:from:date :in-reply-to:message-id:lines:user-agent:mime-version:content-type; bh=MNGs6LC0rhoMBzRwd1QY+lSjU22fFMHlapkAkn2drEg=; b=nTrSL63Jsb7h0/cFtK6GhE0gpg4NZ+pr1v6F68eo21mkWjtR1O7nO38EXBDiz1KFcm gruk7PQ189AhybUtA0fiv/2hG5XxK5yDRBt2FpkoMLGrOqw7GrlpdPZkFIsCx2MtUEea 0M78H9bAs+0/aVSD9uxmM2LGWiP/H1FpED6C4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=x-authentication-warning:to:cc:subject:references:from:date :in-reply-to:message-id:lines:user-agent:mime-version:content-type; b=HFdrNmB7bdXVU5ZuJbcLyzxjxeEr4nslqlLq7Nh8mDkzZLRb7gbhRqN9hfF5DreiwJ p4PLt4DHZ/oayAa6kHJ5tSkfild6BcUFHNk1aHDcPINLQ2rYS77iq8ONPDgAfJcbIzrG FUaT2xF9+yrkGhKWnJr4dbp9+VFrRWBq3xN+U= Received: by 10.103.50.36 with SMTP id c36mr2961431muk.135.1251815155162; Tue, 01 Sep 2009 07:25:55 -0700 (PDT) Received: from localhost.localdomain (abwo59.neoplus.adsl.tpnet.pl [83.8.238.59]) by mx.google.com with ESMTPS id e8sm1241846muf.36.2009.09.01.07.25.53 (version=TLSv1/SSLv3 cipher=RC4-MD5); Tue, 01 Sep 2009 07:25:54 -0700 (PDT) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by localhost.localdomain (8.13.4/8.13.4) with ESMTP id n81EXNLq007446; Tue, 1 Sep 2009 16:33:25 +0200 Received: (from jnareb@localhost) by localhost.localdomain (8.13.4/8.13.4/Submit) id n81EXMRi007443; Tue, 1 Sep 2009 16:33:22 +0200 X-Authentication-Warning: localhost.localdomain: jnareb set sender to jnareb@gmail.com using -f In-Reply-To: User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.4 Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Archived-At: david.hagood@gmail.com writes: > I have a project that is committing several XML files into GIT, and we > have a problem when doing merges. > > The files are UML XMI 1.1 files generated by a UML tool (specifically > Enterprise Architect by Sparx), and EA "helpfully" puts things like > timestamps of modification and access into the files. As you can guess, > these are conflict-magnets. Yes, the ideal solution would be to turn that > off, and I am pursuing that avenue within EA. > > However, it seems to me that if there were some way to plug into GIT's > merging logic, it would be possible to design an XML aware merging tool > that might help on this (generalizing: if you could have content-aware > merging libraries you could make all sorts of merges go more smoothly). > For the specific case of an XML file, if you could have some way to denote > tags and/or attributes that are "don't cares" you could address problems > like I am having. You could also theoretically exploit a knowledge of the > format to better identify what chunks are changes and possibly track > motion within the files better. With Git you are able to use custom merge driver for specific files (files specified by glob, which can be all files) by using `merge` gitattribute (it is about file-level merging in the case of file contents conflict). Or you can use 'merge.default' config variable to set merge driver for all files. Also you can set `diff` filter to custom diff driver which ignores timestamps, or even remove timestamps from files when checking them in using `filter` gitattribute (clean / smudge filters). > Absent that, is there a way to tell git "in case of an unresolvable merge > conflict, don't modify the file but put the other version of the file > somewhere (e.g. filename.other) so that I can use an external tool to > resolve the differences"? In this case, EA doesn't know how to use the > standard conflict tags within a file to extract deltas. You can have `merge` attribute unset , e.g *.uml -merge This means "Take the version from the current branch as the tentative merge result, and declare that the merge has conflicts." Also if you have some graphical merge tool, you can consider configuring and using git-mergetool. -- Jakub Narebski Poland ShadeHawk on #git