gut

An alternative git CLI for Windows, macOS, and Linux

MIT License

Stars
475
Committers
2

Bot releases are hidden (Show)

gut - 0.3.0 Latest Release

Published by julien040 12 months ago

V0.3.0

What is gut ?

Gut is an alternative CLI for Git. It provides consistent command naming and a useful set of features. For further information, please visit the website: https://gut-cli.dev

Example

cd my-awesome-project

# Init a new git repo
gut init

# Do some changes
touch my-billion-dollar-idea.txt

# Commit your new file
gut save # Alias of gut commit

# Sync your changes with the upstream
gut sync

Changelog

Features

  • Gitignore templates now include ".gut" to avoid committing user configuration
  • New command "git ignore update" to stop tracking previously committed files
  • The init command now prompts for a gitignore template
  • Errors generated from a dirty working tree are now more helpful
  • gut save now allows you specify an external editor (instead of using the built-in editor)

Bug fixes

  • Color printing on the Windows Command Prompt should no longer print ANSI codes
  • gut squash now works with a local-only repository

Deprecation

Renaming the gut undo command

As pointed out by an HN commenter, the 'undo' command is not well-named.
Its role is to revert the working tree to the state of the last commit, not to undo the last commit.
This is a subtle but important difference. Therefore, we should rename the command to something more appropriate. I think 'reset' is a good candidate.

Commits

  • 25c3c1e ✨ Add ability to specify commit message editor
  • 82a335f ✨ Add sparse commit #57
  • edee7d1 ✨ Add sparse commit You can now perform a commit without including all the files by specifying them as args: For example: gut save myfile.go myfile.js
  • 465fb33 ✨ New command : gut ignore update
  • 0ef81df ✨ gitignore templates now includes .gut It's very annoying to commit the .gut file (used for profile management) To fix this, the file is now included into the .gitignore
  • e84e84d ✨ init cmd now adds a .gitignore
  • 8efbb35 🐛 Fix out of bound squash commit (fix #58)
  • 18ceeb6 💄 Fix printing issue on Windows cmd (fix #56)
  • dc99070 📌 Update package fatih/color to latest
  • 8a98fb6 🔀 v.0.3.0 merge commit
  • 8cb75ea 🗑️ Create deprecation notice for the undo command
  • 893bb32 🥅 Enhance error handling for dirty tree
gut - 0.2.10

Published by julien040 over 1 year ago

Fix issue with switching branches

Changelog

  • 0277a80 📌 Reverse go-git to v.5.5.1 (#54)
gut - 0.2.9

Published by julien040 over 1 year ago

Bug fix update

⚠️ Due to a bug in switching branches, don't use this version

Changelog

  • e0c413f Bump go-git to 5.7.0
  • 81cc0b5 Merge pull request #52 from julien040/fix/issue-46
  • 485cf51 🐛 Fix: untracked files showing up in status A strange bug in go-git shows files as untracked while git simply ignore them. I couldn't fix the bug so I built a work around. Now gut ignores untracked files
  • 229cada 📝 Add "Feature request" to issue templates
  • 92936e0 🔖 Remove unnecessary dependencies Run go mod tidy
  • 2ce9a62 🚸 Move error printing to stderr (#50)
gut - 0.2.8

Published by julien040 over 1 year ago

Add new capabilities to the switch command

Switch to a commit

You can now switch to a commit using gut switch [commit] similarly to gut goto [commit]

Keep changes in a dirty tree

gut now allows you to keep your changes even if you switch to an existing branch.
You're now able to commit your last modifications to another branch if you chose the wrong one

Commits

  • 6dccd5f ✨Add new capabilites to switch cmd (Fix #47)
gut - 0.2.7

Published by julien040 over 1 year ago

Changelog

  • 2e90b6a ✨ Add flag -v for gut version (#44)
gut - 0.2.6

Published by julien040 over 1 year ago

Changelog

  • 12b3b18 ✏️ Fix typo in blog post file name
  • d7484a1 ✨ Add support for SSH URL
  • 616dbaf 📝 Add blog post about the future of gut futures_of_gut.md lists which changes are gonna be made in the next months It isn't exhaustive but tries to set a guideline
  • 9ecaa95 📝 Reorder README.md I think features and examples should be shown before any installation guide I've moved text about installation after the features I've also added a table of contents. Because the README isn't short, I think it's needed to jump fast to the right information
  • db733bd 📝 Split “isn’t” in README.md (#35)
gut - 0.2.5

Published by julien040 over 1 year ago

Changelog

  • 010f69d Add alpha banner to README.md
  • ed4d92b ✨ Add new command squash (#34)
gut - 0.2.4

Published by julien040 over 1 year ago

Changelog

  • 6d913a3 ✏️ Remove uncorrect capitalization on the README MacOS installation guide uses Brew. In the terminal, brew is called with brew. However, the example was with the first letter in uppercase (Brew)
  • 9d368aa 💄 Fix #31 Text too dark on some terminal (#32)
  • bdce129 📝 Update installation guide in README Gut on Windows now uses scoop to be installed. Also, I've added a tutorial to build from source
gut - 0.2.3

Published by julien040 over 1 year ago

Works on Windows

This release includes support for Windows.

Changelog

  • 059ee46 🐛 Fix #28: Input issue on Windows (#29)
  • 24b1359 💚 Fix build scoop package (#30)
gut - 0.2.2

Published by julien040 over 1 year ago

🎉 New version v0.2.2

Long running commands now have a spinner to reduce frustration.

What's Changed

Full Changelog: https://github.com/julien040/gut/compare/0.2.1...0.2.2

gut - 0.2.1

Published by julien040 over 1 year ago

🎉 New version v0.2.1

Profiles performance

This version improves greatly performance of profiles loading.
You can expect a 6x to 10x in execution time on commands that doesn't need to load a profile.

Help usage

Some commands now have a clearer help message

Changelog

  • c8c8277 Fix #16 - Improving performance of profiles loading (#18)
  • 61d4cc0 🐛 Fix #17 ref not found on init repo (#19)
  • 1fa584e 👷 Remove Apple notarization I've a lot of issues with notarization. I will temporary disable it
  • b5c37f6 💄 Add spinner to status cmd (merge #20)
  • aa2128e 💄 Add spinner to status cmd Because status can be quite slow with a big number of files (hi node_modules 👋), I've added a spinner while go-git is getting the status of files It makes the experience less frustrating
  • 1bdcb84 💬 Update of commands description (#21)
gut - 0.2.0

Published by julien040 over 1 year ago

Changelog

  • bdcd66e Resolves #14, Unable to save a password on headless Linux (#15)
  • bd09ede ➕ Add gnome-keyring & pass to deb/rpm dependencies Because of recent changes to the way gut retrieve/save password, gut now requires new dependencies on Linux. In this commit, they are added to deb and rpm packages
gut - 0.1.0

Published by julien040 over 1 year ago

Changelog

  • 41bff32 🎨 Extract functions of controller in new file
  • 1867fae 🐛 Error message was shown twice This was happening bc cobra prints the error and gut was printing too
  • 7eaccf5 🐛 Fix : gut save doesn't respect .gitignore Because of an issue in go-git, commiting was ignoring .gitignore. I had to parse the .gitignore and fill the .exclude property of Worktree. Now, .gitignore is taken in account. But nested .gitignore are ignored
  • 66e414a 🐛 Fix switch cmd : Uncommited changes on switching Go-git returns an error if there are uncommited changes when switching I added an exit if changes aren't commited
  • cb00d89 🐛 Fix undo cmd Git revert only revert to a specified commit and not everything in between the commit and the head I had to use "double dot" syntax to pass all commits between so that all changes are reverted
  • 215b9ef 🐛 Fix: status cmd not check git init Status wasn't checking if git has been initialized in the directory This would led to go-git returning error
  • a147d5e 🐛 Profile wasn't asking a valid email address for commit Now, on creation of profile, the user is prompt for an email. Add tests for IsEmailValid and isDomainValid
  • 372e7c3 📈 Update URL for analytics
  • 7b882e6 🚸 Save prompt for config To avoid scary messages from Git if the user use gut and git, gut prompt for an username and an email on commit and set it to the local config.
  • a93d90a 🚧 Add clone cmd check if directory is empty
  • b5df1cb 🚧 Branch executor created | History cmd skeleton added
  • 264aa78 🚧 Clone cmd now checks if dir is empty
  • 704e0c8 🔥 Remove auth command | New command setup - The auth command is not needed anymore. Profile already take this role. - To link a profile to a repo, use gut setup auth - Setup is an alias of Init
  • de65a95 💄 Info message are now in cyan
  • 6ba8ead ♻️ Clone command refactor
  • 12789bd ♻️ Remove config package - Profile package now handles decoding and writing to profiles.toml - Because not needed anymore, remove gookit/config
  • 725d302 ✨ Add GitHub authentication - Package retry-go added to handle API request failure - New package provider to interact with platform (gitlab, github, etc.)
  • be89dcd ✨ Add gut ignore ls | Gitignore update Gitignore now has a key for .gut
  • 4fc0ead ✨ Add gut sync command | Structure code changes
  • 46b4d97 ✨ Add history command
  • ab852be ✨ Add status command
  • 626fd6e ✨ Gut Clone fully implemented
  • 2ecb75a ✨ Init and setup auth command created | New check for init To ensure a repo is inited before commiting, I made a new function : checkIfGitRepoInitialized: Now, if no repo is inited, the user is prompt to do it If he refuses, it exits
  • 3ed1d05 ✨ Profile cmd implemented
  • ef6f513 ✨ Profile internal functions implemented
  • bbd2a80 ✨ Profile linked to repo
  • a8eb0c8 ✨ Save command created
  • a0d0f93 💬 Rewrite input of CLI For better clarity, rewrote error printing and Gut save help messages
  • 9eccf89 💬 Rewrote prompt from "we" to "I"
  • 6a720aa 🎉 The start of a never-ending project
  • 7c3476e 🚚 New command added - Diff : Show the difference between Head and the file - Fix : Fix mistakes using git - History : show history of commits - Undo : revert change of the working tree to the last commit
  • 4be3e3e 🚚 Undo command renamed to revert Due because now, new "undo" cmd deletes changes since last commit
  • 765eb2c ✅ Add test for controller
  • 1fa5808 Merge pull request #1 from julien040/feature
  • 5226340 Merge pull request #11 from julien040/telemetry
  • 1eb98bf Merge pull request #12 from julien040/fix/gitmoji
  • 7f7080c Merge pull request #2 from julien040/feature
  • a030f1f Merge pull request #3 from julien040/feature
  • 3890002 Merge pull request #4 from julien040/feature
  • 27ddbc9 Merge pull request #5 from julien040/feature
  • 4887f3e Merge pull request #6 from julien040/feature
  • 3b7939c Merge pull request #7 from julien040/feature
  • 9723267 Merge pull request #8 from julien040/feature
  • cdb4b80 Merge pull request #9 from julien040/feature
  • 9cedba2 ♻️ Keyring provider change 99designs => zalando With Go 1.19.5, I had a weird issue with the macOS Keychain Password could be blocked and not readable from gut Issue seems fix with zalando keyring and Go 1.19.4
  • 57c4311 ✏️ Fix typo in error message
  • 1ca9e15 ✨ Add Remote cmd
  • a31840a ✨ Add Undo command Undo use git revert to work It lists commits from the current branch and prompt user to choose one Once choosen, exec package is used to call git revert -m option in git revert is used to simplify merge
  • 27aa7f5 ✨ Add amend --no-edit in gut fix Gut fix can now change content of a commit if it hasn't been pushed yet
  • a92e4c5 ✨ Add blank emoji for gut save May be some projects don't want to use git emoji If they don't want to, they can select the category "no emoji"
  • b1b98a2 ✨ Add branch sorted by last used
  • a5188ee ✨ Add check for detached head To avoid data loss, gut check if the head is detached on commands that modify the working tree
  • 877e3fd ✨ Add goto/lookout command - Goto shows the state of the repository at a given commit and detach head - New function checkIfDetachedHead should be put at the beginning of important functions. It ensure no changes are made while the repo is in detached mode
  • 3379eb9 ✨ Add gut fix (amend commit message) - Add select in gut fix - Add first fix in gut fix (amend commit message) - To be able to prompt for a new commit message, I've extract the prompt of Save cmd in a new function called promptCommitMessage - Change default page size to 6 in prompt.Select to avoid navigation when choosing a fix
  • 87eba8f ✨ Add ignore command Ignore command added It fetches .gitignore template from toptal api. Compare it to the local gitignore And append the remaining items into the local gitignore
  • 2b0a5dd ✨ Add merge command Merge tries to know which platform the repo is using (github, gitlab, etc.) If it figured out, it opens a link to create a pull request If not, it explains to the user how to merge the branch
  • c7955f3 ✨ Add profile rm command
  • bcfe052 ✨ Add telemetry command Used to enable/disable telemetry
  • b6ab0ff ✨ Add undo command Undo revert files to the Head so that the user can remove his changes
  • 34f1456 ✨ Add whereami command Whereami print the HEAD hash and the current branch to replace git rev-parse
  • f8d20ec ✨ Branch command added - Add branch add, branch rm and branch ls - Add status command skeleton - Rewrote exitOnError command (exit message removed)
  • 0928002 ✨ New error handling for known errors If the error happens a lot (e.g. exit on input), it can be added to the error.go file Known errors are then explained in the gut website
  • a2faaaf ✨ Update: Whereami cmd shows if in detached head
  • 4667cb9 ✨ Update: branch rm can delete remote branches Using git, branch rm can delete the remote branch with "git push --delete " It only runs if git is installed and only one remote is in the repo
  • 4a90a9c ✨ Update: gut sync rebase when no ff possible If go-git can't resolve the pull as a fast-forward, we call the git cli Gut sets the local config flag pull rebase to true if not set. If a value is already set, we don't touch it and leave as is. This lets Git do a rebase if the user doesn't want something else
  • a0275ec ✨ Update: status cmd shows if in detached head
  • dfff9d4 🎉 Add gut diff command Gut diff show the differences between commits and branches If the selected commits have been pushed to GitHub or GitLab, it opens the compare page in the browser
  • 107d35f 🐛 Add check uncommited change in merge/sync Because the save cmd requires flag, it can't be called from another command I've removed the call for the merge command Also, a pull won't work if the working tree isn't clean. I've added a check for the working tree in the sync cmd
  • 4b45f96 🐛 Fix a weird bug in consent.toml I don't know why, but I can't use writeString() to write to the file.
  • a5509d6 🐛 Fix merge work tree not clean Merge cmd didn't check if the working tree was clean If not, it would have led to an error in Git
  • 9288ea3 🐛 Fix: Switch should not check for detached head Because switch is used to revert back to a "normal state", it shouldn't be checking if the head is detached. With that, it wouldn't be possible to go back to a normal state
  • 294ea98 🐛 Fix: Sync not working empty repository If the repo is empty, pulling won't working Before the patch, it was exiting. Now it continues to push This bug would have cause issues with first commit on a remote repository
  • dabeaff 🐛 Fix: gitignore still tracking file after added If a user add a file to the .gitignore and it was already tracked, it won't be deleted Gut ask if the user want to clean the git cache
  • c58c126 🐛 Fix: ignore cmd running git rm without repo After changing the .gitignore, gut ignore prompt to untrack new files added to the .gitignore But gut would still do so even if no repo have been initialized This means git would generate an error Now, gut check if a repo has been initialized before prompting. If there is no repo, gut doesn't ask the user.
  • 6bc52d8 🐛 Fix: prevent merge from and to the same branch Before, if the user put in arg the name of the actual branch, no error would be generated. This would mean you can merge "main" into "main" for instance. Now, if the branch in arg is the same as the current branch, the user would be prompted again to set another branch to be merged
  • 1da5af3 🐛 Fix: profile issues When a new profile is created, it wasn't added to the global profiles list If the user would list immediatly after the list of profiles without restarting the cli, the profile won't be available Password prompt was buggy. It was working with an empty password and won't let the user exiting with ctrl+c
  • a443510 🐛 Update: add all uses git if installed Because go-git doesn't handle .gitignore well (https://github.com/go-git/go-git/issues/108), gut will preferably use git rather than go-git if it's installed
  • 88717d3 👷 Add rpm, deb, snap and brew tap packages Using nfpms, add rpm and deb packages Homebrew tap is now available at julien040/gut-tap
  • b6fa120 👷 Setup goreleaser with doppler Goreleaser builds binaries for Windows, MacOS and GNU/Linux However, MacOS requires Notarisation to launch binaries downloaded. When goreleaser finished bulding, it launches a post-hook:notarise.sh This script submits the macOS binaries to Apple servers. Because it doesn't sign binaries, the first launch of gut on macOS will require an internet connection so that macOS can validate the binary. To load the secrets for the notarisation, I use doppler. It runs the the notarisation script with ENV vars set. I do the same for the release script in order to have a github token
  • 6089993 💄 Add spinner to sync
  • 456f4d0 💄 Update: Info color change from cyan to blue I've found blue being more readable than cyan on a terminal Now, any info message printed with the print package will be shown in blue rathen than cyan
  • 00a26e1 💄 Update: print package - Message func has a new color called optional. It prints in gray - Message has now an interface similar to printF with placeholder
  • 25634d9 💥 Switch behaviour change - Switching on a new branch now keeps the changes in the working tree so that they can be commited in the new branch - Switching to an existing branch with uncommited changes should prompt the user to continue. If the answer is yes, changes are lost thanks to the "force" flag in go-git
  • 358bccd 💬 Add message for sync in merge cmd Remind the user to sync its changes before opening a pull request
  • 01d0d53 💬 Update domain in error handling
  • 58481c4 💬 Update sync prompt in merge In last commit, merge was reminding the user to sync its changes Now, it prompts the user. If the user wants to, gut will run gut syncand go back to gut merge then
  • 26b4db4 💬 Update: history shows short commit hash In order to simplify hash retrieval, now when the user choose a commit, the short hash will be print in yellow
  • adfcc69 💬 Update: remove ambiguity save cmd Before, when gut commited changes, it would print stats similar to git However, Git shows the number of lines added/removed while gut the number of files added/removed. It could be ambiguous for git users so I changed the print message to files added / files deleted
  • e994479 📈 Add anonymous telemetry If telemetry settings is not set, we should ask the user if he wants to enable it. To do so, we run a function called promptForTelemetry before executing the command in root.go The telemetry is anonymous, it gets the command called, the CPU Cores, the OS, the arch and the version of CLI Any function should now call LogCommand at its beginning to log the event To send the event to the server without blocking the running of the command, we use a goroutine. However, to ensure that the request is sent before closing the CLI, we use a WaitGroup. It defers closing only when sendEvent is done
  • 90aa211 📈 Add telemetry for commands When a command is called, it's now logged However, it only takes os.Args. This means if the user types "branch rm", only branch would be logged
  • 5135846 🚑 Fix: undo not exiting after prompt confirmation Because of a missing return, undo would still reset files even if the user said no
  • 00cb66e 🚧 Add skeleton explain cmd gut explain explains what a command does and how It's to help to transition back to git
  • 961cc2f 🚧 Update: explain add some text Remove some placeholder for most commands and add a real equivalent Add a sort because arg list in prompt doesn't follow map declaration order
  • 5c3b9ad 🥅 Update error handling for text input Any error generated by an input will now uses exitOnKnownError This command redirects the user to the gut website so that we can help to resolve the issue
  • e4a9731 🩹 Add missing gitmoji in save cmd "Add a dependency" was missing
  • 5186f15 🩹 Fix: Duplicate git emoji of 📦
  • 2384b82 🩹 Remove duplicate in Git Emoji