Easy-to-use CUI for fixing git conflicts


Easy-to-use CUI for fixing git conflicts


I never really liked any of the mergetools out there so I made a program that is somewhat easier to use.

Preview

๐Ÿ‘ท Installation

Execute:

$ go get github.com/mkchoi212/fac

Or using Homebrew ๐Ÿบ

brew tap mkchoi212/fac https://github.com/mkchoi212/fac.git
brew install fac

๐Ÿ”ง Using

fac operates much like git add -p . It has a prompt input at the bottom of the screen where the user inputs various commands.

The commands have been preset to the following specifications

Keybinding Description
w show more lines up
s show more lines down
a use local version
d use incoming version
e manually edit code
j scroll down
k scroll up
v [v]iew orientation
n [n]ext conflict
p [p]revious conflict
h, ? [h]elp
q, Ctrl+c [q]uit
[w,a,s,d,?] >> [INPUT HERE]

โš™๏ธ Customization

The above key-bindings and various behaviors can be altered by creating a .fac.yml file in your home directory. Please refer to the configuration README.md for more information.

โœ‹ Contributing

This is an open source project so feel free to contribute by

๐Ÿ‘ฎ License

See License

Owner
Comments
  • Feature Request: Change key binds

    Feature Request: Change key binds

    Hello,

    WASD are a great fit for qwerty keyboards but for people having non qwerty keyboards, they are quite bad actually. For example on an azerty keyboard, it should be ZQSD.

    I was wondering if it would be possible to add a feature to reconfigure key bindings in order to have a better usability on every keyboard layout.

    Thank you for this great tool !

  • Add man page

    Add man page

    This PR adds a man page. It uses a trick that ripgrep uses to convert a Markdown file into man page for easier writing and maintenance.

    Here's what it looks like rendered:

    rendered fac man page

  • Invalid number of conflict markers

    Invalid number of conflict markers

    I have created a repo to test fac. I created a sample file, then I created two branches and made two different changes in that file, than I merged those branches into master, got a conflict and tried to run fac to fix it. Here is the terminal output(besides the error itself please mention that fac does not add \n after the error message, which makes bash print status message on the same line after fac exit.

    ~/src/factest (master|MERGING) โ†’ ls
    somefile
    ~/src/factest (master|MERGING) โ†’ cat somefile
    <<<<<<< HEAD
    aa
    ||||||| merged common ancestors
    aaaa
    =======
    dddd
    >>>>>>> second
    bbbb
    cccc
    ~/src/factest (master|MERGING) โ†’ fac
    Invalid number of remaining conflict markers~/src/factest (master|MERGING) โ†’
    
    โ†’ git --version
    git version 2.15.1
    
  • Long list of conflicts hide the help

    Long list of conflicts hide the help

    When you have a long list of conflicts, the help text with the keyboard shortcuts is hidden.

    Git has often this notion of selecting ? for showing help with an explanation for the choices.

    Perhaps you could mimic what Git does in interactive tools on the command line and list all the possible keys on the command prompt with a question mark ? at the end. If the question mark is selected it would print the keys meaning somewhere.

  • Build error

    Build error

    Hi,

    Thanks for the project, looks really nice and I'd really want to try it! But for now, I can't get to build it...

    I barely now anything about go, so if you need more information just tell me what you need:

    go version go1.8.3 gccgo (GCC) 7.2.1 20171224 linux/amd64

    stderr: https://gist.github.com/Aethelflaed/d813e7bd535ea27fe460c4f6fa4a9567

  • Crash while resolving large number of conflicts

    Crash while resolving large number of conflicts

     [w,a,s,d,e,?] >> panic: runtime error: slice bounds out of range
    
    goroutine 337 [running]:
    github.com/nsf/termbox-go.PollEvent(0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0)
            /Users/else/go/src/github.com/nsf/termbox-go/api.go:348 +0x8d4
    github.com/jroimartin/gocui.(*Gui).MainLoop.func1(0xc00020a090)
            /Users/else/go/src/github.com/jroimartin/gocui/gui.go:354 +0x30
    created by github.com/jroimartin/gocui.(*Gui).MainLoop
            /Users/else/go/src/github.com/jroimartin/gocui/gui.go:352 +0x6e
    $ fac -v
    fac 2.0
    
  • brew tap command doesn't find any formulae

    brew tap command doesn't find any formulae

    The fac.rb file needs to be in a Formula directory at the root of the repository.

    After I ran the brew tap command, cd'd into /usr/local/Homebrew/Library/Taps/mkchoi212/homebrew-fac and mv assets Formula the brew install fac command found the formula and installed it successfully.

  • gofmt

    gofmt

    Just ran

    gofmt -w .
    

    on the project root. That's all.

    https://blog.golang.org/go-fmt-your-code


    I made this PR with a project going on over at https://github.com/rotblauer/gofmt-att, and it's definitely a work in progress. So if I got something wrong, or this is annoying at all, please file an issue over there and we'll sort it out.

  • Paths don't resolve correctly when starting fac from sub directory

    Paths don't resolve correctly when starting fac from sub directory

    fac seems to have trouble resolving paths when I start it from anything other than the repositories root directory. In the example below, fac-test is the repository root and file.md is a conflicted file in the sub-dir folder.

    bildschirmfoto vom 2018-01-28 15-21-04

    Anyway, thanks for this tool. I'm looking forward to upcoming features :grin:

  • Long filenames hide the current file marker

    Long filenames hide the current file marker

    Long filenames could hide the marker of the current file. It could be moved to the left and/or different colour for the active file could be used.

    Since filenames are truncated in the sidebar, the full path and filename of the active file could be shown at the top of the main window.

  • Console color doesn't work on windows

    Console color doesn't work on windows

    Trying this with a win10 machine, and it only prints the \x1b[32;1m version on cmd.exe shell (works with Powershell though). e.g. No conflicts detected ๐ŸŽ‰

    Suggestion would be using some other packages like https://github.com/sirupsen/logrus, https://github.com/mattn/go-colorable or https://github.com/fatih/color.

  • docs: 'go get' is no longer supported outside a module.

    docs: 'go get' is no longer supported outside a module.

    hello, @mkchoi212

    read me section - Deprecation of 'go get' for installing executables

    https://go.dev/doc/go-get-install-deprecation

    change bash script

  • Links comes out as black in terminal

    Links comes out as black in terminal

    I moved to a new computer, and fetched an updated version of Fac (great piece of software, thank you) -- and notice that the links in the terminal diffs are black (and also invisible on black foreground).

    I have solved this by making Ansi black into a dark red in ITerm, but I'm assuming this is a common enough issue, so I cretated this issue.

  • panic: runtime error: slice bounds out of range [1:0]

    panic: runtime error: slice bounds out of range [1:0]

    I tried to rebase https://github.com/terraform-providers/terraform-provider-github/pull/96 on top of https://github.com/terraform-providers/terraform-provider-github/pull/108/files and got this.

    First I tried to see the result of previous conflict resolution using [p], but it looked like result was not saved (I use e and a for each change). I edited conflict again, and then the green line appeared at the bottom. I edited one or more conflict before the crash happened.

    
    โ”Œโ”€c2463a8d064e5b683571835fea1bb9580ef9cebc  (Incoming Version)โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”‚โœ” github/resource_github_reposiโ”‚
    โ”‚func resourceGithubTeamMembershipRead(d *schema.ResourceData, meta interface{}) error {                                                โ”‚โœ” github/resource_github_reposiโ”‚
    โ”‚ client := meta.(*Owner).client                                                                                                        โ”‚โœ” github/resource_github_reposiโ”‚
    โ”‚ t, n := parseTwoPartID(d.Id())                                                                                                        โ”‚โœ” github/resource_github_reposiโ”‚
    โ”‚>>>>>>> c2463a8d064e5b683571835fea1bb9580ef9cebc                                                                                       โ”‚โœ” github/resource_github_reposiโ”‚
    โ”‚                                                                                                                                       โ”‚-> 20. github/resource_github_tโ”‚
    โ”‚                                                                                                                                       โ”‚21. github/resource_github_teamโ”‚
    โ”‚                                                                                                                                       โ”‚22. github/resource_github_teamโ”‚
    โ”‚                                                                                                                                       โ”‚23. github/resource_github_teamโ”‚
    โ”‚                                                                                                                                       โ”‚โœ” github/resource_github_team_rโ”‚
    โ”‚                                                                                                                                       โ”‚                               โ”‚
    โ”‚                                                                                                                                       โ”‚                               โ”‚
    โ”‚                                                                                                                                       โ”‚                               โ”‚
    โ”‚                                                                                                                                       โ”‚                               โ”‚
    โ”‚                                                                                                                                       โ”‚                               โ”‚
    โ”‚                                                                                                                                       โ”‚                               โ”‚
    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
     [w,a,s,d,e,?] >> panic: runtime error: slice bounds out of range [1:0]
    
    goroutine 274 [running]:
    github.com/nsf/termbox-go.PollEvent(0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0)
    	/home/anatoli/go/src/github.com/nsf/termbox-go/api.go:356 +0x905
    github.com/jroimartin/gocui.(*Gui).MainLoop.func1(0xc0000fc480)
    	/home/anatoli/go/src/github.com/jroimartin/gocui/gui.go:354 +0x30
    created by github.com/jroimartin/gocui.(*Gui).MainLoop
    	/home/anatoli/go/src/github.com/jroimartin/gocui/gui.go:352 +0x57
    
Watchtower for Git: automatically keep local Git repositories up to date with their remotes

CrowsNest Watchtower for Git: automatically keep local Git repositories up to date with their remotes. Configuration Flags --run-once or -r: Normally

Oct 30, 2022
Nomad is an easy-to-use, flexible, and performant workload orchestrator that can deploy a mix of microservice, batch, containerized, and non-containerized applications
Nomad is an easy-to-use, flexible, and performant workload orchestrator that can deploy a mix of microservice, batch, containerized, and non-containerized applications

Nomad is an easy-to-use, flexible, and performant workload orchestrator that can deploy a mix of microservice, batch, containerized, and non-containerized applications. Nomad is easy to operate and scale and has native Consul and Vault integrations.

Jan 5, 2023
An Easy to use Go framework for Kubernetes based on kubernetes/client-go

k8devel An Easy to use Go framework for Kubernetes based on kubernetes/client-go, see examples dir for a quick start. How to test it ? Download the mo

Mar 25, 2022
CelloDB is an easy-to-use database system implemented in Go

CelloDB CelloDB is the new, easy way to create and query databases. Table of Contents Table of Contents Features More Coming Soon! Features โŒ Querying

Dec 30, 2021
A Simple and Comprehensive Vulnerability Scanner for Container Images, Git Repositories and Filesystems. Suitable for CI
A Simple and Comprehensive Vulnerability Scanner for Container Images, Git Repositories and Filesystems. Suitable for CI

A Simple and Comprehensive Vulnerability Scanner for Containers and other Artifacts, Suitable for CI. Table of Contents Abstract Features Installation

Jan 1, 2023
Create changelogs for Helm Charts, based on git history

helm-changelog Create changelogs for Helm Charts, based on git history. The application depends on the assumption that the helm chart is released on t

Nov 27, 2022
Semantic version generator using git commit keywords and overrides

Semantic version generator Project created overnight, to prove that management of semantic versioning is NOT painful and do not require arguments and

Jan 1, 2023
Hassle-free minimal CI/CD for git repositories with docker or docker-compose projects.
Hassle-free minimal CI/CD for git repositories with docker or docker-compose projects.

GIT-PIPE Hassle-free minimal CI/CD for git repos for docker-based projects. Features: zero configuration for repos by default automatic encrypted back

Sep 23, 2022
Write controller-runtime based k8s controllers that read/write to git, not k8s

Git Backed Controller The basic idea is to write a k8s controller that runs against git and not k8s apiserver. So the controller is reading and writin

Dec 10, 2021
ArgoCD is widely used for enabling CD GitOps. ArgoCD internally builds manifest from source data in Git repository, and auto-sync it with target clusters.
ArgoCD is widely used for enabling CD GitOps. ArgoCD internally builds manifest from source data in Git repository, and auto-sync it with target clusters.

ArgoCD Interlace ArgoCD is widely used for enabling CD GitOps. ArgoCD internally builds manifest from source data in Git repository, and auto-sync it

Dec 14, 2022
Synchronise a directory's contents with a git repository.

git-volume-reloader Synchronise a directory's contents with a git repository. Synchronisation is triggered by a webhook sent by the git service provid

Sep 16, 2022
Fancy Git Clone that preserves directory structures

git go-clone This is fancy wrapper around git clone that preserves directory structures. For example, if you have some complex organization, and you w

Sep 24, 2021
Git Commits as Artwork
Git Commits as Artwork

gitart Git Commits as Artwork What is this? It's pointless! Still here? Generate some fantastic art from your git object ids. Usage Installing To inst

Dec 18, 2021
Simple example using Git actions + Argo CD + K8S + Docker and GO lang

CICD-simple_example Simple example using Git actions + Argo CD + K8S + Docker and GO lang Intro Pre reqs Have an ArgoCD account and Installed. Docker

Oct 28, 2021
A tool that allows you to manage Kubernetes manifests for your services in a Git repository

kuberpult Readme for users About Kuberpult is a tool that allows you to manage Kubernetes manifests for your services in a Git repository and manage t

Dec 16, 2022
The CLI tool glueing Git, Docker, Helm and Kubernetes with any CI system to implement CI/CD and Giterminism
The CLI tool glueing Git, Docker, Helm and Kubernetes with any CI system to implement CI/CD and Giterminism

___ werf is an Open Source CLI tool written in Go, designed to simplify and speed up the delivery of applications. To use it, you need to describe the

Jan 4, 2023
Output all versions of a local git repo, which could be used as test data for your ML program.

gitwalker Output all versions of a local git repo, which could be used as test data for your ML program. Notice This program is under development. Cur

Dec 27, 2021
Git-auto-push - Auto commit and push to github repositories

Auto commit and push to github repositories. How to use git clone https://github

Dec 19, 2022