GUI for conflicts resolution - user-interface

I have a patch and directory to be patched. I can apply the patch with
patch -p0 --merge my.patch
The conflicts are marked then properly (using "<<<<", "====" and so on).
The question is - is there a graphical tool that allow to resolve conflicts marked in such a way? Or is there any other way of graphical conflict resolution in the case i have only a patch and a set of files (directory) to be patched? I tried Kompare but it doesn't work well.

ECMerge, the tool I work on, has a command to do this off-the-shelf, calling ecmerge.exe --open-conflict mydocument.c from the command line does the job (there is a shell extension for Windows/Linux and Mac as well and menu item in the GUI). It offers you the usual 2 or 3-way merge view one would expect in this situation.
ECMerge can also do the job of patch directly and let you preview and merge completely in the GUI with its Patch Import feature.

In case you are using git repository then, instead of using a patch command you
can fire the following command, as shown below :
$ git am -3 < /tmp/0001-Added-feature-hello.patch
Applying: Added feature hello
Using index info to reconstruct a base tree...
M code.c
Falling back to patching base and 3-way merge...
Auto-merging code.c
CONFLICT (content): Merge conflict in code.c
error: Failed to merge in the changes.
Patch failed at 0001 Added feature hello
Use 'git am --show-current-patch' to see the failed patch
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".
To resolve the conflict using GUI fire the following command :
$ git mergetool --tool=meld

Related

How can I use third-party/command line git with MATLAB open?

Using the command line or a third-party git manager, I can execute basic git commands like commit, reset and stash with MATLAB open, presumably because I'm working solely on my local branch. As soon as I want to use git checkout somebranch I get the error:
fatal: cannot create directory at [dir]: Permission denied
What's worse is that my current working directory (on the old branch) now has unstaged changes from the branch I wanted to checkout. Other programs simply reload the files from the newly checked out branch. I've tried finding a way to change how MATLAB locks files but to no avail.
MATLAB R2017b
Windows 10 Pro
More Info
The file structure in my git directory is different between the two branches. I think the issue arises from the fact that a deleted sub-directory was in MATLAB's "set path" list.
First, I would recommend
using a separate git (from the latest Git for Windows and a simplified path)
using a separate working tree (meaning a separate folder) with git worktree.
Second, double-check any locking issue with Process Explorer.

The working copy <Project name> failed to commit files. - The repository has an uncompleted operation

I've just updated my Xcode from 6 to 7 (and code from Swift 1.2 to Swift 2.0) and try to create new branch in Xcode. After that I can't push my code to Bitbucket.
Is there a way how can I delete repository from directory and setup Bitbucket again and maybe push to another (a new one) repository? Fix of this problem will be great, but I will be satisfied even with move to another repository.
I had this error in xcode 7.1 on a year old project that was working fine. In my case I have a project with the default local repository created by xcode. For anyone who is not going to re-install and re-setup. It is possible to find out what the dangling command is and fix it from command line.
To find the dangling command Open Terminal from the project directory:
xcrun git status
In my case the status returned:
On branch master
You are currently rebasing.
(all conflicts fixed: run "git rebase --continue")
To fix the problem I used:
xcrun git rebase --skip
In my case I ran git status which revealed that You are currently bisecting. (I was doing a bisect and must had forgotten to reset). I did a git bisect reset and attached the head to my latest commit and it was all fine afterwards.
When I am merging from currentBranchA into branchB, I got conflicts,I didn't want to solve the conflicts immediately and quit the merging process. But when I try to merge again, the Xcode shows "The working copy is currently in the middle of another operation..."
I opened the terminal ,cd to the project directory, and check the git status:
git status
it shows:
On branch currentBranchA
Your branch is up to date with 'origin/currentBranchA'.
All conflicts fixed but you are still merging.
(use "git commit" to conclude merge)
Just do it as it says. Continue to input
git commit and click Ctrl + C to close the commit message window.
The problem will be zero.
The problem was with installation of GitHub. I had a master repository. After reinstall and resetup everything works like before.
EDIT: For anyone who has a problem with Xcode and GIT I have a best advice. Don't use it. Use for example Source Tree
When you start developing for a living, you are gonna have to use more reliable solution for GIT. Imagine you have 70 branches. Using Source Tree you can easily solve conflicts and other things about working in team. Xcode GIT solution is not reliable and you are gonna be only frustrated.

rubymine commit failed with errors

After pulling from main master, encountering a conflict and resolving conflict.
I'm working in a sub-folder of the main project repo (on automated tests) and so generally don't have to worry about conflicts. It seems however that every time a conflict is encountered and fixed, where I attempt to commit the pulled files RubyMine gives me this error message and won't allow anything to be done to resolve. I've previously taken a new fork from the GitHub main and manually merged in my own lost commits but it's happened again.
I can't find any reference to this dialog on searching the web and our TA has investigated the issue, concluding that it may be a RubyMine bug. I'm continuing my search for relevant info but aside from poring through the bugs in http://youtrack.jetbrains.com/issues/RUBY (which I have now done with no relevant issues found) I can't see where any leads might come from.
Latest version of RM (6.0.3) running on Macbook Pro (Mavericks)
RubyMine was used to resolve the conflicts; git status shows only the pulled files I'm now trying to commit as tracked and uncommitted - I have untracked files managed in a gitignore file
The dialog says:
Commit
Commit failed with errors
With error message displayed in terminal:
Error: Error executing git commit --only -F
[list of files I attempted to commit]
Try like this
Goto Tools -> Open terminal
Use this command
git status
Then add untracked files
git add .
Commit changes like this
git commit -i * -m "commit message"
If you still have errors please post the error. You can see the Version control logs at the bottom of rubymine
Are you using Rubymine to resolve the conflicts? If not, it's possible RubyMine has kept stale state of the filesystem and is reporting the errors because of this.
What does git status . tell you in your working directory? Is your current tree clean, or do you have unmerged changes?

Can git and subversion play nice together?

I have recently decided to take the git plunge, and am really enjoying using git, even on Windows.
My current open source project lives on subversion, all devs are familiar with subversion so I would like to keep subversion as the "source of truth" for now.
Nonetheless, I want to use git, so I went ahead and created a copy of the source on github using git svn. All my work is done against the source in github and I push my changes to github. Once every few days I also push my changes to svn and rebase.
The initial import seemed to go ok, but now every time I do a "git svn rebase" I keep on getting conflicts, even on files I have not changed in my get repository. This is causing me much pain.
Eg.
$ git svn rebase
First, rewinding head to replay your work on top of it...
Applying: Added git ignore file
c:/Users/sam/Desktop/MediaBrowserGit/trunk/.git/rebase-apply/patch:12: trailing
whitespace.
*/obj/*
error: .gitignore: already exists in index
Using index info to reconstruct a base tree...
:12: trailing whitespace.
*/obj/*
warning: 1 line adds whitespace errors.
Falling back to patching base and 3-way merge...
Auto-merging .gitignore
CONFLICT (add/add): Merge conflict in .gitignore
Failed to merge in the changes.
Patch failed at 0001 Added git ignore file
When you have resolved this problem run "git rebase --continue".
If you would prefer to skip this patch, instead run "git rebase --skip".
To restore the original branch and stop rebasing run "git rebase --abort".
rebase refs/remotes/git-svn: command returned error: 1
My questions:
Is there any way I can tell git to sync itself up with svn using svn as the source, so I can start with a clean slate. (export latest, check in changes and reset the svn refs somewhere)
Are there any tips and tricks to getting this scenario to work consistently?
Should I have the core.safecrlf and core.autocrlf options set to true? It seems I will need a bit of hoop jumping.
Related:
http://kerneltrap.org/index.php?q=mailarchive/git/2008/4/16/1450834/thread
http://markmail.org/message/vaois4kkr5ggugqs#query:git%20crlf+page:1+mid:i4flex6vmt5tdala+state:results
http://code.google.com/p/msysgit/issues/detail?id=271
It seems getting line endings right is a bit of a black art.
(I realize that this question probably needs to be expanded, please comment on the places that need expanding)
Are you getting line-ending conflicts? Git has a few configuration properties you can set that change how it handles the end of line characters. I have the following set:
# this makes git NOT attempt to convert line endings on commit and checkout
core.autocrlf=false
# this makes git check if the conversion done by autocrlf would be reversible
# this is probably not required because I do not have autocrlf turned on
core.safecrlf=true
Note that I am on windows, all my coworkers are on windows and I am interfacing with SVN through git-svn. These settings seem to do the trick for me.
(source: codinghorror.com)

How to patch on Windows?

Given a (source) patch file, what's the easiest way to apply this patch on the source files under Windows?
A GUI tool where I can visually compare the unchanged-changed source lines would be great.
A good way to apply a patch file under Windows OS is using Git.
As I understood, Git is a version control solution like SVN.
Here is a guideline to apply a patch :
First of all, download the latest release of the Windows Git Edition here :
GIT
With the cmd prompt, change directory to the patch file and files to patch
Now you can use the following command line :
git apply --ignore-space-change --ignore-whitespace --whitespace=nowarn file.patch
Not that since Git 2.3.3 (March 2015), you can use git apply --unsafe-paths to use git apply outside a git repo.
See commit 5244a31 by Junio C Hamano (gitster)
"git apply" was not very careful about reading from, removing, updating and creating paths outside the working tree (under --index/--cached) or the current directory (when used as a replacement for GNU patch).
The documentation now includes:
--unsafe-paths:
By default, a patch that affects outside the working area (either a Git controlled working tree, or the current working directory when "git apply" is used as a replacement of GNU patch) is rejected as a mistake (or a mischief).
When git apply is used as a "better GNU patch", the user can pass the --unsafe-paths option to override this safety check.
This option has no effect when --index or --cached is in use.
So if you have git installed, git apply could help, even outside of any git repo.
Patch for Windows is what you're looking for.
WinMerge is awesome.
http://winmerge.org/

Resources