Giter VIP home page Giter VIP logo

bhupesh-v / ugit Goto Github PK

View Code? Open in Web Editor NEW
1.4K 10.0 47.0 183 KB

๐Ÿšจ๏ธ ugit helps undo git commands. Your damage control git buddy. Undo from 20+ git scenarios.

Home Page: https://bhupesh.me/undo-your-last-git-mistake-with-ugit/

License: MIT License

Shell 92.09% Dockerfile 7.91%
git-tools git-toolkit fzf-scripts bash-script shell-scripts undo-git-command undo-commands ugit git-undo zgenom

ugit's Introduction

ugit

ugit logo

Undo your last oopsie ๐Ÿ™ˆ๏ธ in git

build ugit Docker pulls total downloads (github + brew) platform support linux and macos git undo text guide Twitter: bhupeshimself

ugit demo: restore file gif

More Video Demos โœจ๏ธ

Undo git add

undo-git-add.mp4

Undo git branch -D

undo-git-branch-delete.mp4

Undo git merge

undo-git-merge.mp4

Why use ugit?

  • You accidentally ran a git command you wish to 'undo'.
  • You want to save time by not searching for how to undo ...
  • Your focus is on the problems at hand and not on Git (avoid context switching)

What's in the box?

ugit/git-undo supports undoing the following operations, some are a WIP. If you know of any other operations that can be undone and are not in the list, make sure to raise an issue or make a quick PR ๐Ÿ’›๏ธ

  • Undo git commit
  • Undo git add
  • Undo git push
  • Undo git branch -D (branch delete)
  • Undo git pull
  • Undo git reset
  • Undo git tag -d (tag delete)
  • Undo git stash apply
  • Undo git stash pop/drop/clear
  • Undo accidental file delete (Restore a deleted file after a commit)
  • Undo (Restore) a file to a previous version
  • Undo git merge
  • Undo git cherry-pick
  • Undo git tag
  • Undo git rebase
  • Undo git worktree remove (recover deleted work-tree)

Contribute to the project by helping me with the above-mentioned tasks.

If you have any other ideas/suggestions, do send them across. Hop in to ugit discussions ๐Ÿ’ฌ๏ธ

News

When What
29 Oct, 2022 ugit crossed 1k stars
02 June, 2022 console.dev featured ugit
18 May, 2022 I gave a talk about the git tooling ecosystem & git undo in Undo git, say whaat! - GitHub India Constellation, May 2022
12 May, 2021 The guide was tweeted by GitHub (I was logging my research process there while building ugit)
30 April, 2021 Featured on Changelog News

Community

Installation

Try ugit via Docker:

docker pull bhupeshimself/ugit
docker run --rm -it -v $(pwd):/app bhupeshimself/ugit

Prerequisites

ugit dependencies:


Packaging status

Linux

sh -c "$(curl -fsSL https://raw.githubusercontent.com/Bhupesh-V/ugit/master/install)"

Arch Linux users can install ugit via AUR.

Mac

brew install ugit

Windows

To use ugit on Windows you need to install:

  1. Git Bash
    Git bash comes with git (if you have installed it on your machine then no need). To install git (preferably with scoop):

    scoop install git
    
  2. FZF

    scoop install fzf
    

    Alternatively, with Chocolatey:

    choco install fzf
    
  3. To use bash in terminal change your directory to **git\2.35.3.windows.1\bin\bash** accordingly.

  4. Then either clone the repo,

    git clone https://github.com/Bhupesh-V/ugit.git

    or get it using curl:

    sh -c "$(curl -fsSL https://raw.githubusercontent.com/Bhupesh-V/ugit/master/install)"

Fig

Fig adds apps, shortcuts, and autocomplete to your existing terminal.

Install ugit in just one click.

ZSH Frameworks

Zgenom

If you're using Zgenom:

  1. Add zgenom load Bhupesh-V/ugit to your .zshrc along with your other zgenom load commands.
  2. zgenom reset && zgenom save

Antigen

If you're using Antigen:

  1. Add antigen bundle Bhupesh-V/ugit to your .zshrc where you've listed your other plugins.
  2. Close and reopen your Terminal/iTerm window to refresh context and use the plugin. Alternatively, you can run antigen bundle Bhupesh-V/ugit in a running shell to have antigen load the new plugin.

Oh-My-ZSH

If you're using oh-my-zsh:

  1. Clone the repository into a new ugit directory in oh-my-zsh's plugin folder:

    git clone https://github.com/Bhupesh-V/ugit.git $ZSH_CUSTOM/plugins/ugit

  2. Edit your ~/.zshrc and add ugit โ€“ same as clone directory โ€“ to the list of plugins to enable:

    plugins=( ... ugit )

  3. Then, restart your terminal application to refresh context and use the plugin. Alternatively, you can source your current shell configuration:

    source ~/.zshrc

Please read โš ๏ธ

Git comes with a garbage collector (in case you didn't know) therefore undoing some commands will become impossible if the entries are deleted from the reflog. One way to prevent this is to increase default time limits before the reflog entries expire.

Add these configurations in your global .gitconfig file:

[gc]
    # default 90 days
    reflogExpire = 200

Used to set how long records in a branch reflog should be preserved.

[gc]
    # default 30 days
    reflogExpireUnreachable = 90

Used to set how long inaccessible reflog records should be preserved.

Not satisfied? ๐Ÿ˜’๏ธ

You can read my in-process guide on How to undo anything in Git

Credit & Thanks

To all the SO threads that I will probably never visit again ;)

โ˜บ๏ธ Show your support

Support me by giving a โญ๏ธ if this project helped you! or just Twitter URL

Support via PayPal

๐Ÿ“ License

Copyright ยฉ 2021 Bhupesh Varshney.
This project is MIT licensed.

๐Ÿ‘‹ Contributing

Please read the CONTRIBUTING file for the process of submitting pull requests to us.

Contributors โœจ

Thanks goes to these wonderful people (emoji key):

Sharan Aithal
Sharan Aithal

๐Ÿ’ป ๐Ÿ“–
Tabulate
Tabulate

๐Ÿ’ป ๐Ÿ“ฆ
Joe Block
Joe Block

๐Ÿ’ป ๐Ÿ“– ๐Ÿ”Œ
Cรฉsar Romรกn
Cรฉsar Romรกn

๐Ÿ’ป ๐Ÿ›
Ilkin Bayramli
Ilkin Bayramli

๐Ÿ“ฆ
Kopal Chakravarty
Kopal Chakravarty

๐Ÿ’ป
Zorawar Purohit
Zorawar Purohit

๐Ÿ“–
Nalin Singh
Nalin Singh

๐Ÿ’ป
vinayaknayar
vinayaknayar

๐Ÿ“–
RohitSingh107
RohitSingh107

๐Ÿ“ฆ
Thรฉotime Maillarbaux
Thรฉotime Maillarbaux

๐Ÿ’ป ๐Ÿ›
dr41d45
dr41d45

๐Ÿ’ป
Taebok Joseph Kim
Taebok Joseph Kim

๐Ÿ’ป

This project follows the all-contributors specification. Contributions of any kind welcome!

ugit's People

Contributors

allcontributors[bot] avatar bhupesh-v avatar cesarcoatl avatar deepsourcebot avatar dr41d45 avatar engagepy avatar ibayramli avatar kopalchakravarty avatar nalin-singh avatar rohitsingh107 avatar sharan-aithal avatar sullivan-sean avatar t-joseph-kim avatar tabulatejarl8 avatar thmaillarb avatar unixorn avatar vinayaknayar avatar wrecklass avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ugit's Issues

publishing to snapcraft

Is your feature request related to a problem? Please describe.
For Linux users, a snap for ugit would be nice so that users don't have to curl the script manually

write tests for ugit brew formula

I have a draft formula ready, but need help with writing test

class Ugit < Formula
  desc "Undo git commands. Your damage control git buddy"
  homepage "https://github.com/Bhupesh-V/ugit"
  url "https://github.com/Bhupesh-V/ugit/archive/refs/tags/v4.1.tar.gz"
  sha256 "5ce35179714263412f65cc78c247900c5349bfbf4bd9576e4075aa1a9055e0d6"
  license "MIT"

  depends_on "bash"
  depends_on "fzf"

  def install
    bin.install "ugit"
    bin.install "git-undo"
  end

  test do
   # not good, will be rejected by maintainers probably
    assert_match "ugit version", shell_output("#{bin}/ugit --version")
  end
end

A basic set of tests would include setting up a directory (non-git) and running the command ugit. The expected output should look like

Ummm, you are not inside a Git repo ๐Ÿ˜Ÿ

Apart from that I am out of ideas of what to test. Since both ugit --version & ugit --help are bad examples.

Any suggestions?

undoing `git tag`

Is your feature request related to a problem? Please describe.

Let's say you accidentally create a git tag, feature to rename a git tag would be nice

Describe the solution you'd like

No response

Describe alternatives you've considered

No response

Incorrect SGR code in 24-bit terminal

What happened?

  1. Install iTerm2 3.5.0beta6
  2. Run ugit
  3. This happens: https://gitlab.com/gnachman/iterm2/-/issues/10510

The 24-bit color SGR code is missing a CSI leader, causing part of the sequence to be printed to the screen.

Ugit Version

v5.1 (Latest)

Bash Version

Bash >= 5.0

Git Version

git version 2.28.0

What OS are you seeing the problem on?

MacOS

Terminal Name

iTerm2 3.5.0beta6

Code of Conduct

  • I agree to follow this project's Code of Conduct

Git BASH for Windows "Not inside top level dir" warning

Is your feature request related to a problem? Please describe.
I have installed Git for Windows which comes with Git BASH, and ugit prints a warning when executed at the top-level directory of the working tree.

$ mkdir ~/git-repo
$ cd ~/git-repo
$ git init
$ ugit
ugit: Not inside top level dir C:/Users/thecesrom/git-repo
Undo your last oopsie in Git ๐Ÿ™ˆ๏ธ
Press ctrl+c to exit anytime

This is because in Git BASH for Windows $(pwd) is a "UNIX" path, and git rev-parse --show-toplevel is a Windows path.

$ pwd
/c/Users/thecesrom/git-repo
$ git rev-parse --show-toplevel
C:/Users/thecesrom/git-repo

Describe the solution you'd like
After reading Git's documentation for rev-parse I have found a suitable option, and I have a PR #22 ready if you're interested.

In this case git rev-parse --show-cdup is a suitable alternative.

--show-cdup
When the command is invoked from a subdirectory, show the path of the top-level directory relative to the current directory (typically a sequence of "../", or an empty string).

See: https://git-scm.com/docs/git-rev-parse#Documentation/git-rev-parse.txt---show-cdup

git rev-parse --show-cdup will only return an empty string if we are at the top-level directory.

$ cd ~/git-repo
$ mkdir -p sub/dir/ect/ory
$ cd sub/dir/ect/ory
$ git rev-parse --show-cdup
../../../../
$ cd ~/git-repo
$ git rev-parse --show-cdup

Describe alternatives you've considered
None.

Additional context
N/A

Fix empty/null condition edge-cases across ugit

I have overlooked handling edge-cases in multiple places, they need to be fixed for a more robut and error prone ugit.

  1. handle no commit situation when undoing git commit, do not open the FZF menu.
  2. return custom string when tags are not present while undoing git tag, again dont invoke FZF

Keeping this open to add more missed edge-cases as I discover. If you are looking to contribute please create separate PRs for each item listed above

Empty commit list when running `git fsck`

Describe the bug
The command git fsck will return no data if there are no unreachable commits in history.

wat

To Reproduce

  • Create a new git repo
  • Stash something
  • Run ugit and try to undo git stash pop

Expected behavior
ugit should exit if there is no data provided by git fsck

Desktop (please complete the following information):

  • OS: [Ubuntu]
  • Bash Version [5.0.17]
  • FZF Version: [0.27.2]
  • Git Version: [2.35.1]

Additional context
Check for this case while recovering deleted tag as well

Remove usage of HEREDOC in favor of `printf` while printing `--help` text

Is your feature request related to a problem? Please describe.

  • Currently, while showing help text, we rely on bash HEREDOCS. This can also be achieved using multiple printf commands one-by-one.
  • Doing this helps us remove the reliance on cat command altogether from the script.

Describe the solution you'd like

Use printf variations like this for the entirety of the help text

printf "\n%s\n" "Contact ๐Ÿ“ฌ๏ธ: $(tput bold)[email protected]${RESET} for assistance"

Describe alternatives you've considered

No response

Add support for running ugit inside docker

Is your feature request related to a problem? Please describe.

We are planning to ship a docker image for ugit, which everyone would be able to pull from dockerhub registry. We need to make few adjustments in ugit for that.

Describe the solution you'd like

To aid this, we will introduce a new boolean ENV variable UGIT_RUNNING_IN_DOCKER. Use this new variabel to perform following things:

  • Don't open the guide when user invokes the script with --guide flag. Instead, just display the URL of the guide.
  • Don't update the script when user invokes the script using --update flag, just print what version of script a user is using, and tell them to pull the latest image.

Other items that are related to this:

Describe alternatives you've considered

No response

git-undo symlink conflicts with git-extras

Describe the bug
If you have git-extras installed that has a git-undo command, ugit can conflict with it.
E.g.: This is what I get when I try to install ugit when git-extras is already installed.

==> Pouring ugit--5.1.all.bottle.tar.gz
Error: The `brew link` step did not complete successfully
The formula built, but is not symlinked into /usr/local
Could not symlink bin/git-undo
Target /usr/local/bin/git-undo
is a symlink belonging to git-extras. You can unlink it:
  brew unlink git-extras

To force the link and overwrite all conflicting files:
  brew link --overwrite ugit

To list all files that would be deleted:
  brew link --overwrite --dry-run ugit

Possible conflicting files are:
/usr/local/bin/git-undo -> /usr/local/Cellar/git-extras/6.4.0/bin/git-undo
==> Summary
๐Ÿบ  /usr/local/Cellar/ugit/5.1: 6 files, 28.7KB
==> Running `brew cleanup ugit`...
Disable this behaviour by setting HOMEBREW_NO_INSTALL_CLEANUP.
Hide these hints with HOMEBREW_NO_ENV_HINTS (see `man brew`).

To Reproduce

brew install git-extras
brew install ugit

Expected behavior
That's a great question and I'm not sure about it. I think there are a few options:

  1. Renaming the git-undo symlink but I'm not sure I can think of an alternative name and this will break existing users who happily run git undo (I also like git undo)
  2. As far as I know Homebrew has some mechanism to deal with conflicting formulae but I'm not sure how it works
  3. Call this out in the readme and in the Homebrew description, the error above is not a fatal one, only the symlink is missing so ugit works but git undo comes from git-extras. If the user decides they want git undo to execute ugit, they just need ask Homebrew to overwrite the link: brew link --overwrite ugit

Desktop (please complete the following information):

  • OS: macOS 12.4 (build: 21F79)
  • Bash Version zsh 5.8.1 (x86_64-apple-darwin21.0)
  • FZF Version: 0.30.0 (brew)
  • Git Version: git version 2.36.1
  • git-extras Version: 6.4.0
  • Homebrew Version: Homebrew 3.5.2
Homebrew/homebrew-core (git revision 3033e2a3b66; last commit 2022-06-18)
Homebrew/homebrew-cask (git revision e83c83c0a2; last commit 2022-06-18)

Additional context
The change was introduced with this issue: #15

Undo git commit results in fatal error when the commit to undo is the initial commit

Describe the bug
When the commit to undo is the initial commit, there is no HEAD~, so undoing this commit results in the following error:

$ ugit
fatal: ambiguous argument 'HEAD~': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'

To Reproduce

$ cd ~
$ mkdir git-repo
$ cd git-repo
$ git init
Initialized empty Git repository in ~/git-repo/.git/
$ touch README.md
$ git add README.md
$ git commit -a -m "chore: initial commit"
$ ugit
Undo your last oopsie in Git ๐Ÿ™ˆ๏ธ
Press ctrl+c to exit anytime
# 1 Undo git commit
# Choose git commit
fatal: ambiguous argument 'HEAD~': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'

Expected behavior
The commit should be undone.

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

macOS

  • OS: macOS 10.15
  • Bash Version: 5.1.16(1)
  • FZF Version: 0.30.0 (brew)
  • Git Version: 2.35.1

Windows

  • OS: Windows 10
  • Bash Version: 4.4.23(2)
  • FZF Version: 0.30.0 (2093667)
  • Git Version: 2.35.1.windows.2

Additional context
vscode fixed this same issue via: microsoft/vscode#47578

Videos don't work in Firefox

I'm not sure if you can do anything about this, or if it's the fault of GitHub or something else, but I'll post an issue anyway.

Describe the bug
The videos in the README and on your blog post don't seem to be working in Firefox

To Reproduce
N/A

Expected behavior
N/A

Screenshots

README

image

Blog

image

Desktop (please complete the following information):

  • OS: Manjaro Linux
  • Browser: Firefox 89.0

Additional context
It seems to work in Chromium 90.0.4430.212 and Microsoft Edge 92.0.891.1

`--pointer=แ…` option not supported by older versions of fzf

Describe the bug
For older versions of fzf, ugit returns the following error when executed:

Undo your last oopsie in Git ๐Ÿ™ˆ๏ธ
unknown option: --pointer=แ…

I'm not sure in which version this option was added to fzf but I've tested with version 0.17.3.

To Reproduce
Install an older version fzf (eg. v0.17.3) and run ugit with no parameters.

Expected behavior
ugit should ignore the fzf error or the oldest functioning version of fzf should be added to the list of dependencies.

Screenshots
N/A

Desktop (please complete the following information):

  • OS: MacOS 11.3
  • Bash Version: fish 3.2.1
  • FZF Version: 0.17.3

Additional context
N/A

fzf before 0.21.0 not supported

What happened?

In older versions of fzf (which are still the default versions in some OSes when installing from the package manager), the option --pointer was not supported. It causes ugit to crash ๐Ÿ‘

theotime@THEOTIME-PORTMINT:~/ugit$ ugit
Undo your last oopsie in Git ๐Ÿ™ˆ๏ธ
Press ctrl+c to exit anytime 
unknown option: --pointer=๐Ÿ‘‰

Ugit Version

v5.1 (Latest)

Bash Version

Bash >= 5.0

Git Version

git version 2.25.1

What OS are you seeing the problem on?

Linux Based

Terminal Name

GNOME Terminal

Code of Conduct

  • I agree to follow this project's Code of Conduct

I'd like to add an oh-my-zsh-compatible plugin file

I'd like to add an oh-my-zsh compatible plugin file. This will let users of oh-my-zsh compatible shell frameworks automatically add ugit to their shell setup, and with some frameworks, automatically keep it up to date by periodically running git pull.

Describe the solution you'd like

Basically I'm going to write a very short (~3 lines of code) plugin file that the frameworks can load to automatically add the ugit repository to the user's $PATH.

Add AUR Version to README

Is your feature request related to a problem? Please describe.
I have packaged and submitted a version of this package to the AUR, which I can maintain, and if you would like to add it to the README, that would be a pretty easy fix

Describe the solution you'd like
Add instructions on how to install from the AUR to the README

Describe alternatives you've considered
I mean, you could not add it if you want

remove usage of `basename` on `--help` argument

Is your feature request related to a problem? Please describe.

Currently when printing help text for ugit ugit --help, we figure out the basename of the current running script. Which seems and looks good but adds unnecessary overhead of external command usage.

 $(basename "${BASH_SOURCE[0]}")

More about BASH_SOURCE

BASH_SOURCE
                An array variable whose members are the source filenames where
                the corresponding shell function names in the FUNCNAME array
                variable are defined.  The shell function ${FUNCNAME[$i]} is
*               defined in the file ${BASH_SOURCE[$i]} and called from
*               ${BASH_SOURCE[$i+1]}.

Describe the solution you'd like

Just reference "ugit" string directly.

Describe alternatives you've considered

No response

Add tput to dependency list

At first thanks for bringing such an undoing tool entirely in Bash.

What is the problem?

tput is maybe missing in some other os. I think it is better to add it in dependency list of ugit.

I would like to contribute if I have any new feature to add it here.๐Ÿ˜

auto detect last `git` command

Is your feature request related to a problem? Please describe.
Since v1.0 users have to type what they want to undo. I added this just to give more control to users in choosing how and what they want to undo

Describe the solution you'd like
A new arg/flag --auto should incorporate detecting the last git command to undo.
A simple solution would be to read the user's last 10-15 commands from their $HISTORY file then grep through the file to find basic git commands and trigger the appropriate functions already available.

Additional context
Some git commands would be tricky to detect for e.g. is no way one could defer an unpused merge commit to a merge with conflicts.
the solution should only handle basic git commands like commit, stash which can be easily detected.

Feel free to ask anything below

Undo `git worktree remove`

Is your feature request related to a problem? Please describe.

Add the ability to undo the "removal of a git worktree"

Describe the solution you'd like

No response

Describe alternatives you've considered

No response

ugit (via docker) does not resolve that it is in a git repo.

What happened?

Attempted invoking ugit via

docker pull bhupeshimself/ugit
docker run --rm -it -v $(pwd):/app bhupeshimself/ugit

Even in the ugit repo that has been cloned (or any other git repo), always get the following message:

Ummm, you are not inside a Git repo ๐Ÿ˜Ÿ

Test Repo

/home/auser/Projects/TestGitRepo
total 58
drwxrwxr-x 3 auser auser 4 Feb 5 15:45 .
drwxrwxr-x 300 auser auser 305 Feb 5 15:58 ..
drwxrwxr-x 8 auser auser 14 Feb 5 15:45 .git
-rwxrwxr-x 1 auser auser 147 Feb 5 15:44 ungitInvoke

Using the script directly works fine.

Maybe a missing environment variable or volume mapping that is unaccounted for?

Ugit Version

v5.1 (Latest)

Bash Version

Bash >= 5.0

Git Version

Whatever versions that are in the current docker image for all of the above.

โฏ docker images

REPOSITORY TAG IMAGE ID CREATED SIZE
bhupeshimself/ugit latest 6c57f819c864 2 days ago 14.9MB

What OS are you seeing the problem on?

Linux Based

Terminal Name

SSH'ed into Ubuntu 22.04 host.

Code of Conduct

  • I agree to follow this project's Code of Conduct

Add a git-undo symlink

git will call scripts that are named git-SOMETHING when you run git SOMETHING.

Describe the solution you'd like

Add a git-undo symlink to ugit to make it callable consistently with other git commands as git undo.

Additional context

This will make using ugit more pleasant since it'll be consistent with other git commands.

iTerm colors issues

I have a color issue in iTerm, tried different settings/profiles, could not get it work, on the default terminal macos app it works ok, so it's something related to iterm or my settings, do you have any suggestions?
Thank you for this great tool!
image

Ability to travel back b/w TUI panes

Is your feature request related to a problem? Please describe.

It's possible that a user might hit enter on an incorrect item from the list. Any pets on the keyboard?

Describe the solution you'd like

  • Check if travelling b/w menu options is possible
  • Document where we can travel back
  • Set a keystroke to go back

Describe alternatives you've considered

No response

unhandled `fzf --version` output

What happened?

When executing ugit. Itโ€™s checks for fzf version on line ugit#L410 and excepts an integer.

However, the output of fzf --version in my device is:

$ fzf โ€”-version
0.29 (devel)

Hence, the script couldnโ€™t handle the string part and exited.

You can add the cut or tr to split by spaces and get the first element.

fzf_version=$(fzf โ€”-version | cut -d " " -f 1 | cut -d "." -f 1,2 | tr -d '.')

Ugit Version

v5.1 (Latest)

Bash Version

Bash >= 5.0

Git Version

2.38.2

What OS are you seeing the problem on?

Linux Based

Terminal Name

zsh

Code of Conduct

  • I agree to follow this project's Code of Conduct

installation docs for Windows

ugit should work on Windows considering we have either git bash installed or WSL working with the FZF binary.
It would be nice to have docs to install ugit the correct way.

Any help/suggestions are appreciated ๐Ÿ’™

Sort tags in proper order in "Undo git tag"

Is your feature request related to a problem? Please describe.

The current ugit method to undo_git_tag() calls git tag. This presents the tags in a string sort order that looks incorrectly sorted with numeric tags. For instance:

v1.0
v1.1
v1.10
v1.11
v1.2
v1.3
v1.4

etc.

Describe the solution you'd like

Use git tag --sort=v:refname to present tags in correct order:

v1.0
v1.2
v1.3
v1.4
v1.10
v1.11

etc.

Describe alternatives you've considered

You could create your own sorting method, but why?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.