Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

Evaluating a Git merge

  • 27-01-2017 5:14pm
    #1
    Registered Users, Registered Users 2 Posts: 8,593 ✭✭✭


    I've been asked to check if a merge was done correctly.
    Is there a way to do this other than manually going through the diff output which is quite big?

    Thanks.


Comments

  • Registered Users, Registered Users 2 Posts: 8,593 ✭✭✭funkey_monkey


    Figured out a way of checking it.

    Resolved.


  • Registered Users, Registered Users 2 Posts: 6,262 ✭✭✭Buford T Justice


    Figured out a way of checking it.

    Resolved.

    Can you post the solution so it might help others?


  • Registered Users, Registered Users 2 Posts: 8,593 ✭✭✭funkey_monkey


    I was asked to ensure that no additional changes were made by a user when they merged their local branch into the main branch. I'm sure there are better and/or more efficient ways of doing this, but below is what I done.


    I used (from memory):

    git log --grep <SEARCH TEXT>

    The search text for me was the problem reference (development task) under which the user made their updates. This brought up the commit(s) I was interested in. I needed to see what updates the user made - this was repeated a few times for various commits.

    git diff commit_ref^ commit_ref

    The ^ character refers to the commit previous to the comm_ref.

    This allowwed me to build up a picture of all the changes made by the user.

    When it was merged into the mainline branch I then was able to diff the commit and the previous commit to see the differences and was able to cross reference them to see that only the changes made in the local branch were merged into the mainline branch.


    If anyone has a better way of doing it please share. I'm new to using git.


    Where my initial checks went wrong was that I was diffing the merge commit with the previous local commit. This meant it was showing up all commits made by previous users.

    So essentially I done checks on the local branch to see what changed and then checked the merged commit with the previous mainline commit and was then able to perform the manual comparison to see if it was correctly merged.

    That is what I done. Whether it is the correct thing to do I don't know. Hopefully the more experienced on here can show a more efficient way of working it out.



    Thanks.


Advertisement