From: Constantine Plotnikov <constantine.plotnikov@gmail.com>
To: Clemens Buchacher <drizzd@aon.at>
Cc: git@vger.kernel.org, Dave Olszewski <cxreg@pobox.com>
Subject: Re: [PATCH] refuse to merge during a merge
Date: Thu, 28 May 2009 20:00:53 +0400 [thread overview]
Message-ID: <85647ef50905280900v274d87ag8d364ea7bd9a97ee@mail.gmail.com> (raw)
In-Reply-To: <20090527210410.GA14742@localhost>
MERGE_HEAD file could also happen in case of --no-commit option. In
that case there might be no conflict and the message would look
confusing to the user. I suggest to change a message to "You are in
the middle of a uncommitted or conflicted merge." or something like
it.
Regards,
Constantine
On Thu, May 28, 2009 at 1:04 AM, Clemens Buchacher <drizzd@aon.at> wrote:
> The following is an easy mistake to make for users coming from version
> control systems with an "update and commit"-style workflow.
>
> 1. git merge
> 2. resolve conflicts
> 3. git pull, instead of commit
>
> This overrides MERGE_HEAD, starting a new merge with dirty index. IOW,
> probably not what the user intented. Instead, refuse to merge again if a
> merge is in progress.
>
> Reported-by: Dave Olszewski <cxreg@pobox.com>
> Signed-off-by: Clemens Buchacher <drizzd@aon.at>
> ---
>
> builtin-merge.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/builtin-merge.c b/builtin-merge.c
> index 0b58e5e..74a8c8f 100644
> --- a/builtin-merge.c
> +++ b/builtin-merge.c
> @@ -836,7 +836,7 @@ int cmd_merge(int argc, const char **argv, const char *prefix)
> struct commit_list **remotes = &remoteheads;
>
> setup_work_tree();
> - if (read_cache_unmerged())
> + if (read_cache_unmerged() || file_exists(git_path("MERGE_HEAD")))
> die("You are in the middle of a conflicted merge.");
>
> /*
> --
> 1.6.3.1.147.g637c3
>
> --
> To unsubscribe from this list: send the line "unsubscribe git" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
next prev parent reply other threads:[~2009-05-28 16:01 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-05-27 21:04 [PATCH] refuse to merge during a merge Clemens Buchacher
2009-05-28 16:00 ` Constantine Plotnikov [this message]
2009-05-28 16:12 ` John Tapsell
2009-05-30 8:37 ` Clemens Buchacher
2009-05-30 10:38 ` Jakub Narebski
2009-05-30 10:57 ` Thomas Rast
2009-05-31 10:43 ` Clemens Buchacher
2009-05-31 11:05 ` John Tapsell
2009-05-31 14:05 ` Clemens Buchacher
2009-05-31 19:36 ` Junio C Hamano
2009-06-01 9:20 ` [PATCH v3] " Clemens Buchacher
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=85647ef50905280900v274d87ag8d364ea7bd9a97ee@mail.gmail.com \
--to=constantine.plotnikov@gmail.com \
--cc=cxreg@pobox.com \
--cc=drizzd@aon.at \
--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).