git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Philip Oakley <philipoakley@iee.org>
To: ARAM MALIACHI <maliachi.aram@gmail.com>,
	git@vger.kernel.org, v-armal@microsoft.com
Subject: Re: change inside PR not reflected in the resulting squash commit
Date: Sun, 2 Jun 2019 21:11:55 +0100	[thread overview]
Message-ID: <7a6d8cf4-91e8-7cf2-bcc6-9b3a1a2f4382@iee.org> (raw)
In-Reply-To: <CAOkV5k19NupZ3L=2QiRuYer8-gMBFM9TKuW5RR2zzHhnVmfZ6w@mail.gmail.com>

Hi Maliachi,
It's a quiet night. I'll have a go...
I have spaced out your text..

On 31/05/2019 22:03, ARAM MALIACHI wrote:
> I’m an Azure DevOps support engineer for Microsoft. Prior to composing
> this communication to the Git team I had a conversation with the
> Product Group from Azure DevOps stating this could be expected
> behavior, truth is they didn’t take the time to analyze this with me
> stating our PR system does nothing extra to the regular Git tool.
PR systems can add extra processing steps which allow the flow to be 
more complex that at first glance. Not sure which PR admin system this 
one is..
> However I’m still suspicions about it since I consider myself advanced
> in Git workflows.
> Customer completed a PR from release/Pl4S1R4 into master. PR's id 5238.
This will be a series at a specific base commit.
> Several commits made up this PR: 15 approximately were added to the
> source branch release/Pl4S1R4 while the PR was active.
extras, extras, opportunity for confusion...
> 2 out of 15 commits made the exact same change to the exact same file
> on the exact same lines.
Be wary of terminology here. If the _final_ series was linear without 
merges, then such diffs don't exist, hence the assumption is fallacious.
>   One of these two commits was committed to
> source branch directly
So you have a 'side' branch change, and the PR later merges with this.
>   and the other one is a squash merge commit that
> resulted from another PR completion
A further 'side' branch (for the squash series), and later merges into 
the PR.
>   to source branch coming from a 3rd
> branch while the original PR 5238 was active.

> Specifically commits [descending order]:
> 13ade36d - squash commit of a third branch coming into source branch
> 42940662 - commit made directly to the source branch
> Specifically, both commits include along many changes the following
> change to file /src/components/Layout/Menu.vue on line 80 and line 91
> Original version of file line 80 and 91:
> 80   {{menuOptions.NETWORK}} {{'v'}}
> 91   {{network.name}} {{'v'}}
> Resulting version of the file in line 80 and 91 for both commits:
> 80   {{menuOptions.NETWORK}}
> 91   {{network.name}}
I.e. you have clean (non) merges! they all agree on the right final 
answer. These merges have other content, so have sufficient diffs to 
look interestingly complete, while their earlier commits on the side 
have diffs that give you to think that there are identical changes 
within the PR (rather than being outside of the series)

Have a look at the new "--rebase-merges" (and the discussion threads) 
for some of the issues about bringing in disparate changes via merging in.
> The weird thing which raises a flag for me is that making the same
> change to the exact same file 2 times wouldn't even be possible at all
> since first change would make its current status the desired one and
> therefore the next commit with the same change wouldn't even highlight
> the lines as change. I believe this could be due to the nature of the
> second commit coming from a PR completion [squash] where maybe the
> file was kept unchanged.
I guess it is a time flow disconnect (things you thought static 
changed), and perhaps history simplification (the graphs missed 
important bits) that has caused the confusion (assuming I have 
understood the problem statement, and guessed right as to the 
awkwardness of explaining it)
> What I would expect here is that the PR would read the file and would
> ignore the second change made by squash commit since this exact change
> had already taken place previously.
> Above all this despite the PR having 2 commits highlighting the exact
> same change on a file, the resulting squash commit ignored them both
> and showed the lines 80 and 91 in the affected file as untouched.
> I carefully verified with cx that no other commit would 'revert' this
> two changes or even edit the file /src/components/Layout/Menu.vue
> again so it seems like the system indeed ignored them both on its own.
> Note that other changes to different lines of the affected file were
> recorded correctly in the resulting squash commit once PR was
> completed.
>
> Due to the complexity of cx's environment, I haven't been able to
> reproduce the issue myself, but the proof is inside the PR stored in
> cx's Project.
It should be able to make a toy example with a similar profile. just 
make sure that you have a full DAG covering the three PR series (master 
branch initial state, PR5238, squash-PR, direct commit PR, final state) 
You'll only need a few commits on each. It will be a worthwhile learning 
exercise for you, and to show to colleagues.
--
Philip
PS I could be wrong.

      reply	other threads:[~2019-06-02 20:11 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-31 21:03 change inside PR not reflected in the resulting squash commit ARAM MALIACHI
2019-06-02 20:11 ` Philip Oakley [this message]

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: http://vger.kernel.org/majordomo-info.html

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

  git send-email \
    --in-reply-to=7a6d8cf4-91e8-7cf2-bcc6-9b3a1a2f4382@iee.org \
    --to=philipoakley@iee.org \
    --cc=git@vger.kernel.org \
    --cc=maliachi.aram@gmail.com \
    --cc=v-armal@microsoft.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://80x24.org/mirrors/git.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).