From: Jakub Narebski <jnareb@gmail.com>
To: "Richard Hartmann" <richih.mailinglist@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: commiting while the current version is in conflict
Date: Thu, 16 Oct 2008 16:42:06 -0700 (PDT) [thread overview]
Message-ID: <m3ljwojeeu.fsf@localhost.localdomain> (raw)
In-Reply-To: <2d460de70810161510ha220593g4615a55b2c3e3b25@mail.gmail.com>
"Richard Hartmann" <richih.mailinglist@gmail.com> writes:
> I fooled around with git a liitle bit and noticed something
> rather strange. I merged two branches, creating a conflict
> on purpose. When I then did a
>
> git commit -a
>
> all changes were submitted. Of course, I now have a
> file with the conflict markers inlined in my repository. Not
> a good thing, imo. Is there a way to make git block all
> conflicting versions?
The default pre-commit hook shipped with git includes this check.
All you have to do is enable it: it has to be named 'pre-commit' and
it has to be exacutable. In older git version you would do:
$ chmod a+x .git/hooks/pre-commit
while in never versions it would be
$ mv .git/hooks/pre-commit.sample .git/hooks/pre-commit
> Also, I would be interested in the design decissions
> behind the current behaviour. Any pointers?
It is a git policy that it ships with all hooks disabled.
P.S. You can always bypass pre-commit hook (for example if comitting
AsciiDoc files, which may include something that looks like conflict
markers, or if you are committing test which includes conflicted file
as one of test vectors), by using `--no-verify' option to git-commit.
--
Jakub Narebski
Poland
ShadeHawk on #git
next prev parent reply other threads:[~2008-10-16 23:43 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-10-16 22:10 commiting while the current version is in conflict Richard Hartmann
2008-10-16 22:48 ` Miklos Vajna
2008-10-16 23:00 ` Shawn O. Pearce
2008-10-16 23:26 ` Richard Hartmann
2008-10-17 1:16 ` Avery Pennarun
2008-10-16 23:07 ` Richard Hartmann
2008-10-16 23:23 ` Shawn O. Pearce
2008-10-16 23:31 ` Richard Hartmann
2008-10-16 23:42 ` Jakub Narebski [this message]
2008-10-17 7:25 ` Richard Hartmann
-- strict thread matches above, loose matches on Subject: below --
2008-10-16 23:39 Junio Hamano
2008-10-17 7:21 ` Richard Hartmann
2008-10-17 8:37 ` Junio C Hamano
2008-10-17 9:32 ` Richard Hartmann
2008-10-17 9:16 ` Jakub Narebski
2008-10-17 9:35 ` Richard Hartmann
2008-10-17 9:36 ` Junio C Hamano
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=m3ljwojeeu.fsf@localhost.localdomain \
--to=jnareb@gmail.com \
--cc=git@vger.kernel.org \
--cc=richih.mailinglist@gmail.com \
/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).