How can I select deleted code in the diff view of GitKraken? - gitkraken

How can I select deleted (red) code in GitKraken?

You can't select it if you're in Hunk or Inline views. However, you can select it in Split view.
If you want to copy a specific deleted line, or all deleted lines in a hunk, you can simply right click it:

There is an open request to add this feature in the Hunk view: https://feedback.gitkraken.com/suggestions/197805/copy-deleted-lines-from-diff-view-hunk-inline
Meanwhile, just use Split view, as mentioned above.

Related

Handling [re]moved lines with Meld visual diff and merge tool

I have a question about the Meld visual diff and merge tool, which is probably a simple misunderstanding.
But how do I adopt lines that were removed in the $REMOTE?
Please see the screenshot below for an example. I have changed the order of the imports and created a merge conflict, so now I want to pull the first change from the right, but then also the second change that would remove those lines that now already exist at top of the imports. I could remove them manually of course, but surely there is an easier way?
Or am I wrong with my assumption, that the middle pane is the result that gets written to $MERGED?
Edit: In this contrived example, I actually have a Delete action that I can use to remove those lines. But in a real-world merge I'm trying to do with meld the Delete action is greyed out, as is the Pull from Right action.
Any idea why Meld wouldn't allow me to Delete those lines that will be made obsolete by a Pull from Right above them?
I found out that holding the Shift key allows me to remove individual changes.

Select nonadjacent lines containing a common phrase in vscode

I have an HTML file that has around 700 of my bookmarks. Each line has link and a tag like the following:
<li>Strunk, William, Jr. 1918. The Elements of Style</li>
The file has multiple lines with the same tags. I want to group the lines with the same tag next to each other. I was trying to do it in vscode. I can select multiple occurrences of the same phrase with Ctrl+Shift+L, but I could not select the lines. Is there a way for doing this?
After your comment below that clarified what you are trying to do I think you will find this easier than your solution.
Select the text to check.
Ctrl-Shift-L selects all occurrences. The command is Select All Occurrences of Find Match - if that is bound to something else on your OS, use that.
Ctrl-L will select the entire line. (Changed from Ctrl-i in Feb. 2019.) That is using the command Expand Line Selection - again find that command in your Keyboard Shortcuts and use the same command.
Cut and paste them where you want.
There is also an extension vscode-dup-checker that will find and delete duplicate lines. I don't know if you actually want to delete the duplicates though.
I added a gif to show it in action - it only uses steps 1-4 above:
Ok, I found one method that works. I don't know if it the best though.
After Ctrl+Shift+L, you have cursors on all the lines with that phrase. Then pressing Home will take you to the beginning of all of them and Shift+End then will select all those lines on which you have the cursor. Then cut the text and paste it wherever you wish. Came out to be pretty useful for me while I was editing a html file with 700 links.

Headings inside table cells don't appear in Navigation pane: workaround?

I have a long table. Not realizing that headings inserted inside a table don't appear in the Outline View or the Navigation Pane (See Blom's answer to http://answers.microsoft.com/en-us/msoffice/forum/msoffice_word-mso_other/headings-do-not-appear-in-navigation-pane/c3ff186f-8363-47e2-9f46-8f2cf83d78b4), I put a bunch of Heading 1 and Heading 2 headings inside my table. Now I'm having trouble jumping around inside my document.
The brute force approach that has occurred to me is to split the table after every heading, and take the heading out of the table.
Any other ideas?
MS Word 2010.
This is a known issue and Stefan Blom's answer still holds:
It is a known limitation in Word that headings inside table cells won't appear in the Navigation pane. For what it's worth, the same thing applies to the predecessor of the Navigation pane, the so-called Document Map, in older versions of Word.
As you have noticed, Word properly adds headings inside a table to the TOC, fortunately.
If you want the headings to appear in the navigation pane you have to place them outside of tables, i.e. your suggested approach is the way to go.
If you still want the heading to appear like it is part of the table you can simulate that by adding a paragraph border around your heading. (Note: This still does not work if it is in a table cell. You must be outside the table cell.)
I had the same problem and found useful this alternative:
Select desired text inside the table and insert Bookmarks from Insert > Bookmarks:
Type a Name and add the bookmark :
Use Bookmark Panel (CTRL+SHIFT+F5) or "Go To" command to navigate inside the document
In my case, headings weren't shown because I mixed heading and body text. Example(black text: heading):
OR operator Displays records if any condition is TRUE
So I solved it putting the body text below
OR operator
Displays records if any condition is TRUE

How can I use a link to source code in GitHub Issue?

I want to reference certain lines from a file in a GitHub repository in an issue. How can I do this without copying and pasting manually? Can I use a link to the source code?
To clarify, here is the file that I want to reference code from:
mysource.py
1: def func1():
2: for i in range(10);
3: print 'hello world'
4:
5: def func2():
6: for i in range(10);
7: print 'hello world'
I want to quote lines 5 to 7 of the file in my issue like this:
5: def func2():
6: for i in range(10);
7: print 'hello world'
You can now do this by selecting a range of lines and using the create issue menu option:
Example
...resulting in:
Steps
Go to the source file
Select the range of lines (e.g., click the first line of interest, then shift + click the last line)
From the ... menu on the left, select create an issue
An issue page will appear with a link to the lines, which renders as view of the source code.
You can add the following hash-fragment.
https://github.com/username/repo/mysource.py#L5-L7
Just tried it without even knowing it was possible.
The key is to get a permalink to the code, that will be automatically converted to the code snippet by GitHub Markdown (GFM). After completing the steps below, the whole thing should look like this after you create an issue or comment:
Live example
Follow these steps:
Go to the page with source code that needs to be referenced. For example: https://github.com/roots/trellis-cli/blob/master/cmd/venv_hook.go
Click on the line number next to the respective code. The selected line should now be colored with yellow, and the three dots button should appear next to the line number, like that:
Tip: if you want to reference multiple lines of code, click on the first line number, then hold Shift and press the second line number.
Click on the three dots button, select "Copy permalink":
Go to the issue where you want to reference the code. Paste the permalink there. The link should look like that:
https://github.com/roots/trellis-cli/blob/a389115eb35e3c322e084183dc41497ffd67e7e0/cmd/venv_hook.go#L25-L27
Notice that the link to the source code now has a commit SHA in the URL instead of the branch name master.
No, this is not possible. However, you can create line comments on the Files Changed tab of pull requests which can reference issues through the standard # referencing.

How to switch the order of files (original and modified) in Eclipse Compare window?

When comparing two files, for example during a commit, Eclipse shows the original version on the right and modified on the left:
However, I would prefer to see the original version on the left and modified on the right. Is it possible?
Eclipse Neon.2 (4.6.2) has a button to swap the views:
You can either swap the views for every compare, as one answer suggests:
Or you can make the swapped order be the default for all compares:
Windows --> Preferences --> General --> Compare/Patch
Select the Text Compare tab, and mark the check-box of Swap left and right
I think it's just depending of which file you're selecting first. I mean, choose a file, and select compare to .. and choose another one. Next choose the second one and compare to the first one, they'll swap in your window :)
This behaviour is influenced by what exactly is compared. When comparing two local files the view is influenced by the first & second selection. If using e.g. GIT the left hand side will always be what is present locally, the currently checked-out branch or local changes - so changing the branch will influence the view. When using SVN it is mostly the same, so left hand locally, right hand remotly.