git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Michael J Gruber <git@drmicha.warpmail.net>
To: Christian Gagneraud <chgans@gna.org>, git@vger.kernel.org
Subject: Re: Hacking git for managing machine readable "source" files
Date: Mon, 12 Oct 2015 10:07:12 +0200	[thread overview]
Message-ID: <561B6A30.4060406@drmicha.warpmail.net> (raw)
In-Reply-To: <561B29DA.9050101@gna.org>

Christian Gagneraud venit, vidit, dixit 12.10.2015 05:32:
> Hi git hackers,
> 
> I have been scratching my head since quite a few weeks to see if and how 
> I could hack git to manage non-software-source-code files. Theses files 
> might be text-based (XML, JSON, custom format, ...) but are not intended 
> for humans, thus diffing and merging them using standard git features 
> doesn't really make sense (and so the whole "pack" stuff seems useless 
> as well). These files represent a non-software project developed using a 
> graphical SW application. I'm talking here about designing and 
> simulating electronic projects, but it could be apply to any sort of 
> engineering (mechanical design comes second to me)
> 
> I would like to provide support for diffing, merging, branching and 
> forking such electronics projects.

[wall of text snipped]

I don't think you need to map the tree structure of your project to that
of git's object store, nor am I sure you would benefit from it. (In case
you do want to do it - look at the git-notes implementation.)

There are four handles in git's interface that you can use (and that
have been used):

A) clean/smudge filters: They are meant to transform your working tree
copy into a "standard/canonical form" which is stored in the repo (and
back).

As an example, uncompressing compressed file formats, removing
superfluous comments or time-stamps, sorting in default order (for
unordered files) produces objects in the repo which are a better fit for
packing and possibly also for git's default diff.

B) textconv filters: Possibly lossy filters that produce a human
readable form of an object which possibly also lends itself to a
meaningful git diff (but no way back). Can be cached.

C) external diff drivers: They are supposed to produce a meaningful diff
in cases where textconv+default diff are not enough. They simply receive
both objects to diff.

D) external merge drivers: They are supposed to merge (non-text) files
that git cannot merge.

You'll find pointers in the manual pages for git-diff, git-merge and
gitattributes.

Michael

      reply	other threads:[~2015-10-12  8:07 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-12  3:32 Hacking git for managing machine readable "source" files Christian Gagneraud
2015-10-12  8:07 ` Michael J Gruber [this message]

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=561B6A30.4060406@drmicha.warpmail.net \
    --to=git@drmicha.warpmail.net \
    --cc=chgans@gna.org \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).