Sublime Forum

Cant tell what each column is from

#1

the left and righht columns showing the chunks need a title at the top stating exactly what they are showing. i want to do a merge of a specific branch onto origin/master and am THOROUGHLY confused about what I am looking at here.
I have NO indication of what is in either column.

0 Likes

#2

Hi @mark4,

By default, Sublime Merge displays per-hunk titles when the context can be determined. This depends on the syntax the file uses, so it may not work for all files.

If you could give me an example of where this isn’t working for you, I can investigate it for you :slight_smile:

Thanks,
- Dylan

0 Likes

#3

With regards to the merge tool, if you hover over the column title (the commit hash), it will show a description of the commit in which it came from.

0 Likes

#4

when i hover over a hunk the only change is the appearance of the “hunk history” button I can not tell if one column is origin/master or my latest checkin of some branch or the current edits of some branch. there is no indication as to what branch either column represents.

0 Likes

#5

Hi @mark4,

When a historical commit is selected, the diff shows the changes made in that commit. In other words, it’s showing the difference between the selected commit, and the commit before the selected commit.

When the diff is in side-by-side mode, the left side shows the lines removed in the currently selected commit (highlighted in red), and the right side shows the lines added in that commit (highlighted in green).

0 Likes

#6

then how do i do a selective merge between two branches -I h ave a development branch and master. dev has a HUGE number of changes in it that absolutely MUST NOT be merged into master
I need to merge dev into master on a change my change basis, NOT on a comit by commit basis
so what i need is master on the left, dev on the right and line by line by line by line by line select what bits of dev need to move into master and what parts of master need to be deleted.
this absolutely CANNOT be based on a checkins… is what i am trying to do even possible?

0 Likes

#7

Hi @mark4,

What you’re aiming to do is quite difficult with Git. With Git, ideally each branch is a single unit that can be merged in as a whole.

That being said, it’s not impossible to do. You can do what’s called a “cherry pick” to copy an individual commit into a branch (you can read more about them here https://git-scm.com/docs/git-cherry-pick).

When cherry picking, it copies the contents of the commit and commits it straight away by default. As you want to change the contents of each commit before committing (discard unwanted changes), you will want to do a cherry-pick --no-commit for each commit you want to copy.

This can be done in Sublime Merge by right clicking the commit you want to copy into the current branch, and selecting Cherry Pick Commit > Cherry Pick No Commit

This will begin copying the commit into the current branch, but stop to allow you to make changes before it is committed.

I hope this helps you!

Thanks,
- Dylan

1 Like

#8

cherry picking commits would not help me, let me splane my problem : )

I have inherited some HORRENDOUSLY badly formatted, badly engineered and badly coded code. It is utterly unreadable in its present form and I am not allowed to make major changes to it. I do have to work with it so in MY development branch, every single file I need to work on i have fixed the formatting, replaced all the interleaved tabs and spaces with just spaces… beautified the sources etc.

as a trivial example of what I am faced with…

if(fudge_factor=1) {
this entire block of code including all {
other nested blocks are NOT INDENTED }
}

Once the code is beautified I am able to read it - not necessarily understand fully it but I can read it. I can now make the required changes and test them.

I check in every change I make in my dev branch but only the authorized changes are to be merged in - I want to keep my beautification. As I touch a function its changes AND its beautification shall be merged into master - all other no essential changes are not to be merged.

This requires the ability to do line by line by line merges from dev into master so I need to see BOTH.

The only way I can think of to resolve this is to copy my entire dev tree, check out master and use a merge/diff tool to merge them on a line by line basis, not a commit by commit basis.

Git is extremely powerfull and… utterly counter intuitive, not only does it allow you to shoot yourself in the foot the way I have, it demands you do so in order to learn how IT thinks you should do development. :confused:

TYVM to the entire dev team at sublime hq, this one is on me. I will learn from the pain of my “mistakes”.

0 Likes