git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: custom diff - text file diary entries

From
Andreas Ericsson <ae@op5.se>
Date
Dec 30, 2010, 12:22 UTC
Message-ID
<4D1C7979.9050400@op5.se>
In-Reply-To
<AANLkTimPTYEWr0qQwYM4jmJSLcrLRt27GC0nTVgVzHK2@mail.gmail.com>
On 12/30/2010 12:33 PM, Zenaan Harkness wrote:
Show 20 quoted lines
> 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.
Previous: Zenaan HarknessNext: Zenaan Harkness
Message 2 of 4 in “custom diff - text file diary entries”
  1. Zenaan HarknessDec 30, 2010
  2. Andreas EricssonDec 30, 2010
  3. Zenaan HarknessDec 30, 2010
  4. Santi BéjarDec 30, 2010

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.