unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Ingo Lohmar <i.lohmar@gmail.com>
To: Alan Mackenzie <acm@muc.de>
Cc: Emacs developers <emacs-devel@gnu.org>,
	Kaushal Modi <kaushal.modi@gmail.com>
Subject: Re: Understanding a recent commit in emacs-25 branch [ed19f2]
Date: Sun, 03 Apr 2016 14:30:27 +0200	[thread overview]
Message-ID: <87bn5qeuxo.fsf@acer.localhost.com> (raw)
In-Reply-To: <20160403121458.GC3537@acm.fritz.box>

Hi Alan,

On Sun, Apr 03 2016 12:14 (+0000), Alan Mackenzie wrote:

> Is there a way of asking "if I attempt git merge, will there be any
> conflicts?"?  It would be nice to find this out before one's working
> directory gets lots of uncommitted changes.

Just do the merge, and if you get conflicts that you do not want to
resolve, 'git merge --abort'.

Single caveat: Do NOT start a merge when you have uncommited changes.
If you want, do 'git stash' first to recover them later.

>
> Is there a way of recovering after doing git pull, when git has already
> written all the pulled changes to the working directory?  Is there some
> way of saying git undo-partial-pull, leaving the working directory as it
> was before the pull, and cancelling the merge which git has started?

See above.

> Sorry, I wasn't very clear.  What I meant was, is there a way of
> finishing the merge locally, then pushing real changes without the
> confusing "pseudo-merge" escaping upstream with them?
>
> When I did git pull, there were, let's say, 20 commits.  19 of these
> could have been moved directly into my local repository; only one had a
> conflict.  It would be nice to be able to fix the local repo, so that
> the "pseudo-merge" of these 19 blameless commits remains a purely local
> affair, and doesn't get pushed upstream.

It seems you are confused about some concepts.  The 'fetch' part of
'pull' has already dragged *all* commits into your local repository.
Now the question is about how to merge the branches (say 'master' and
'origin/master').  Here I can no longer follow your explanation.  I have
a feeling you actually want to avoid the merge commit as far as
possible.

In this case, you have to learn about rebase, as in 'git rebase
origin/master'.  This replays your commits (which should be only local)
on top of origin/master.  You will have to fix any conflict in your
commits, and you will end up with a linear history with your commits on
top of those already on origin/master.

Abort a rebase-gone-bad by 'git rebase --abort'.



  reply	other threads:[~2016-04-03 12:30 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-01  5:32 Understanding a recent commit in emacs-25 branch [ed19f2] Kaushal Modi
2016-04-01  5:43 ` Kaushal Modi
2016-04-01  6:43   ` Paul Eggert
2016-04-03 12:03     ` Alan Mackenzie
2016-04-03 12:10       ` Achim Gratz
2016-04-03 14:18         ` Stefan Monnier
2016-04-03 14:49           ` Óscar Fuentes
2016-04-03 18:15           ` Achim Gratz
2016-04-03 18:45             ` Andreas Schwab
2016-04-03 18:56               ` Eli Zaretskii
2016-04-03 20:02               ` Paul Eggert
2016-04-03 21:15                 ` Andreas Schwab
2016-04-03 23:11                 ` John Wiegley
2016-04-03 12:18       ` Ingo Lohmar
2016-04-03 11:17   ` Alan Mackenzie
2016-04-03 11:27     ` Andreas Schwab
2016-04-03 11:40     ` Ingo Lohmar
2016-04-03 12:14       ` Alan Mackenzie
2016-04-03 12:30         ` Ingo Lohmar [this message]
2016-04-03 14:12           ` Andreas Schwab
2016-04-03 14:57             ` Ingo Lohmar
2016-04-03 15:08               ` Andreas Schwab
2016-04-03 15:12               ` Eli Zaretskii
2016-04-03 15:01           ` Eli Zaretskii
2016-04-03 15:23             ` Ingo Lohmar
2016-04-03 15:40               ` Eli Zaretskii
2016-04-03 16:00                 ` Ingo Lohmar
2016-04-03 16:19                   ` Eli Zaretskii
2016-04-03 16:24                     ` Andreas Schwab
2016-04-03 17:09                       ` Eli Zaretskii
2016-04-03 17:35                         ` Andreas Schwab
2016-04-03 18:04                           ` Eli Zaretskii
2016-04-03 11:44     ` Dmitry Gutov

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

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87bn5qeuxo.fsf@acer.localhost.com \
    --to=i.lohmar@gmail.com \
    --cc=acm@muc.de \
    --cc=emacs-devel@gnu.org \
    --cc=kaushal.modi@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.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).