User: Password:
|
|
Subscribe / Log in / New account

Document Collaboration

Document Collaboration

Posted Mar 6, 2014 17:27 UTC (Thu) by bronson (subscriber, #4806)
In reply to: Document Collaboration by epa
Parent article: Using git and make for tasks beyond coding

This is absolutely right. Does git allow running a command on a file after automatically merging it? If git could send C files through lint or render TeX files to null, and mark any failure as a merge conflict, that might reduce the potential damage.

Somewhat in the same vein as git's diff.external.


(Log in to post comments)

Document Collaboration

Posted Mar 6, 2014 19:16 UTC (Thu) by kleptog (subscriber, #1183) [Link]

Well, you can configure a mergetool which is called after merge conflicts. In theory it would be possible to have a tool which understands the structure of XML documents of code and tries to produce an output which is at least well-formed.

Document Collaboration

Posted Mar 7, 2014 2:26 UTC (Fri) by bronson (subscriber, #4806) [Link]

Very true. But I'd like it to run the mergetool, then ALWAYS run some sort of linter over the result, whether or not Git thinks there may be a conflict. It's would be a sanity check for epa's not-quite-plain-text files.

But I guess I don't want it bad enough to suggest it on the vger git list... :)

Document Collaboration

Posted Mar 9, 2014 6:01 UTC (Sun) by dlang (subscriber, #313) [Link]

well, you can configure your mergetool, and since you can do that you can call a script that calls the default tool and then runs your linter.

or you can call a post-commit hook to run the check after each commit (and since a merge is a commit...)

Document Collaboration

Posted Mar 9, 2014 16:39 UTC (Sun) by mathstuf (subscriber, #69389) [Link]

The post-commit hook doesn't run during a rebase though (unless you commit --amend), so when combining commits during a rebase, you may miss changes.

Document Collaboration

Posted Mar 9, 2014 21:38 UTC (Sun) by dlang (subscriber, #313) [Link]

well, it just adds one more thing to the many things that can go wrong when you rebase, doesn't it ;-)

but when you go to merge that rebase into anything else, the post-commit hook will run.


Copyright © 2018, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds