Git development
 help / color / mirror / Atom feed
From: "brian m. carlson" <sandals@crustytoothpaste.net>
To: Al Grant <bigal.nz@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: Rebase
Date: Mon, 20 Jan 2025 01:32:27 +0000	[thread overview]
Message-ID: <Z42nq54yuWqiU4t6@tapette.crustytoothpaste.net> (raw)
In-Reply-To: <CAODtcdfS+TVmrwohtHFUXRZRwC1WmF5ENpZLVoZTyJgA--SC-Q@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 2385 bytes --]

On 2025-01-19 at 20:39:13, Al Grant wrote:
> Yes. But I'm keen to understand how to deal with a merge conflict.
> 
> My IDE is VSCode and when I run the merge I get this image:
> 
> https://imgur.com/a/vynTxaj
> 
> Which highlights this code:
> 
> 255: <<<<<<< HEAD
> 256:        samples = signal.convolve(samples, [1]*189, 'same')/189
> 257:
> 258:        #for testing - log to file
> 259:        #self.f.write(samples.astype(np.float32).tobytes())
> 260:
> 261:=======
> 262:        samples = signal.convolve(samples, [1] * 10, "same") / 189
> 263:
> 264:        # for testing - log to file
> 265:        # self.f.write(samples.astype(np.float32).tobytes())
> 266:
> 267:>>>>>>> 1f893dc (Make project runnable on Linux)
> 
> Now I would assume that samples = .... from ln 256 abd 262 are the
> differences between MAIN and FEATURE?
> 
> But when I search main (at least I think its main - my IDE doesnt tell
> me mid rebase process) for ` samples = signal.convolve(samples,
> [1]*189, 'same')/189` AND `samples = signal.convolve(samples, [1] *
> 10, "same") / 189` - those lines do not exists anywhere in MAIN???
> 
> So what is going on????

First, I recommend that you set the `merge.conflictStyle` setting to
`diff3` so that you get the contents of the merge base as well.  That
can be illustrative when you have conflicts.

It's important to note that a rebase involves replaying individual
commits from one branch on top of another, usually using a merge
algorithm.  That means that it isn't necessarily the case during a
rebase that one side is the complete base branch, but rather one side is
the base branch _with all of the previous commits you've rebased on top
of it_.

So if you have this:

 A - B - C - D - E - F (main)
     \
      - G - H - I - J (feature)

and you rebase `feature` on to `main`, you're going to replay G, H, I,
and J (in that order) on top of F.  So it might not be that the code
exists in `main`, but that it comes from one of those intermediate
commits.

In this case, the conflict should be trivial to fix up in that the code
appears (at least to a first glance) to be logically equivalent.  I
would personally resolve this conflict in favour of the version with a
little more whitespace, since that seems nicer to read.
-- 
brian m. carlson (they/them or he/him)
Toronto, Ontario, CA

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 263 bytes --]

  parent reply	other threads:[~2025-01-20  1:32 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-19  5:29 Rebase Al Grant
2025-01-19 16:21 ` Rebase brian m. carlson
     [not found]   ` <CAODtcdf-+QpPpB5R-hLkKWKacwM=N3=XRDs-tK60W9WzUJu7xw@mail.gmail.com>
2025-01-19 20:39     ` Rebase Al Grant
2025-01-19 23:08       ` Rebase D. Ben Knoble
2025-01-20  1:32       ` brian m. carlson [this message]
2025-01-20 21:15         ` Rebase Al Grant

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=Z42nq54yuWqiU4t6@tapette.crustytoothpaste.net \
    --to=sandals@crustytoothpaste.net \
    --cc=bigal.nz@gmail.com \
    --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