git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andreas Ericsson <ae@op5.se>
To: Zenaan Harkness <zen@freedbms.net>
Cc: git@vger.kernel.org
Subject: Re: custom diff - text file diary entries
Date: Thu, 30 Dec 2010 13:22:17 +0100	[thread overview]
Message-ID: <4D1C7979.9050400@op5.se> (raw)
In-Reply-To: <AANLkTimPTYEWr0qQwYM4jmJSLcrLRt27GC0nTVgVzHK2@mail.gmail.com>

On 12/30/2010 12:33 PM, Zenaan Harkness wrote:
> Problem:
> Separate text file diary entries, committed in separate repos,
> cause merge clash when pushed to central repo,
> since git thinks the two entries are a single conflicting entry
> (since they begin at the same location in the same file).
> 
> What we need is two diary entries automatically detected and inserted
> into the one file, one above the other (ordering is not so important).
> 
> Desired outcome:
> Two new diary entries - two separate insertions into the text file,
> not the conflict.
> 
> Is there an easy way I can automate this diary entry merging, so my
> users don't have to manually resolve the conflict?
> 
> Please note: SOMETIMES, one user will go and correct spelling and/ or
> grammar fixes in another person's diary entry, or in their own older
> diary entry - this is quite common.
> 

It seems like what you really need is a database backend for this that
you simply take normal backups from every once in a while, or a script
that produces the desired output on the fly from many different files.

If you really, really want to use git for this, you could create your
own custom merge driver. How to do so is reasonably well documented in
examples and man-pages. You'll want to sneak a peak at the attributes
page.

-- 
Andreas Ericsson                   andreas.ericsson@op5.se
OP5 AB                             www.op5.se
Tel: +46 8-230225                  Fax: +46 8-230231

Considering the successes of the wars on alcohol, poverty, drugs and
terror, I think we should give some serious thought to declaring war
on peace.

  reply	other threads:[~2010-12-30 12:22 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-30 11:33 custom diff - text file diary entries Zenaan Harkness
2010-12-30 12:22 ` Andreas Ericsson [this message]
2010-12-30 12:36   ` Zenaan Harkness
2010-12-30 13:47     ` Santi Béjar

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=4D1C7979.9050400@op5.se \
    --to=ae@op5.se \
    --cc=git@vger.kernel.org \
    --cc=zen@freedbms.net \
    /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).