Comments (6)
@auscompgeek I haven't. Forgot about that! Thanks for the tip!
OK, so this works:
git config --global mergetool.fac.cmd fac
git config --global merge.tool fac
Now git-mergetool
starts fac
. However, it's started with all files and when you close it, Git opens it for the next file. So it's not suitable in this mode. I think it should detect it's used as a mergetool based on the command line arguments passed to it and open only the specified file so this workflow works.
from fac.
I have no idea. I will look into it though! Thanks for the heads up!
from fac.
@hkdobrev Did you set mergetool.fac.cmd
, as per git-config(1)
?
from fac.
Tried fmt.Println(len(os.Args), os.Args)
but seems like nothing special is passed to the program by git
. Any ideas on how we could detect if git-mergetool
started fac
?
Only one that comes to my mind is running ps || pgrep
to find if git-mergetool
is running.
from fac.
A number of environment variables are set by git-mergetool(1)
. You could take a look at how the known mergetools to git are implemented by looking at the shell scripts in /usr/lib/git-core/mergetools/
.
You can pass any argument you like in the cmd setting, so there's definitely no need for pgrep hacks.
from fac.
From git help config
:
mergetool.<tool>.cmd
Specify the command to invoke the specified merge tool. The specified command is evaluated in shell with the following variables available:
BASE
is the name of a temporary file containing the common base of the files to be merged, if available;
LOCAL
is the name of a temporary file containing the contents of the file on the current branch;
REMOTE
is the name of a temporary file containing the contents of the file from the branch being merged;
MERGED
contains the name of the file to which the merge tool should write the results of a successful merge.
So the configuration in .gitconfig
should be something like:
[mergetool.fac]
cmd = fac $BASE $LOCAL $REMOTE
An example from the opendiff
mergetool opening FileMerge from XCode:
"$merge_tool_path" "$LOCAL" "$REMOTE" -ancestor "$BASE" -merge "$MERGED" | cat
I guess you can either specify arguments or command line options for these and include a simple shell file in the repo to run it. This way it would be a 2-line configuration to use fac
as your mergetool :)
from fac.
Related Issues (20)
- Support for fixing conflicts outside Git repositories HOT 3
- Feature request: Key input without pressing enter HOT 20
- cannot execute binary file: Exec format error HOT 1
- Build error HOT 4
- Paths don't resolve correctly when starting fac from sub directory HOT 2
- Feature Request: Change key binds HOT 13
- What about `e` to edit or `o` to open HOT 15
- Replace Godeps directory with dep
- Remove emojis from output messages HOT 2
- Syntax highlighting doesn't seem to work
- "Parent of" sticks around after resolving conflict HOT 1
- b for both
- How to show context of 4 lines by default during merges? HOT 3
- Crash while resolving large number of conflicts HOT 3
- help isn't shown
- panic: runtime error: slice bounds out of range [1:0] HOT 1
- View previous conflict resolution
- Status
- Links comes out as black in terminal
- switch from dep to Go modules HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fac.