diff --git a/CHANGELOG.md b/CHANGELOG.md index 7d0c3ab..26e19ea 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,7 +6,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -## Unreleased + + +## [0.0.4] - 2020-11-10 ### Fixed @@ -21,6 +23,13 @@ and this project adheres to - Option `--stash` auto stashes unstaged changes. Thanks to Sebastian Buck (@betwo) for the idea and implementation. +### Deprecated + +- I am considering removing the `qf` alias in a later release. Please vote + [here][1]. + +[1]: https://github.com/siedentop/git-quickfix/issues/6 + ## [0.0.3] - 2020-10-03 ### Removed diff --git a/Cargo.lock b/Cargo.lock index 87376af..f09def7 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -191,7 +191,7 @@ checksum = "f6503fe142514ca4799d4c26297c4248239fe8838d827db6bd6065c6ed29a6ce" [[package]] name = "git-quickfix" -version = "0.0.3" +version = "0.0.4" dependencies = [ "assert_cmd", "color-eyre", diff --git a/Cargo.toml b/Cargo.toml index 5ea32d5..ab8503a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "git-quickfix" -version = "0.0.3" +version = "0.0.4" authors = ["Christoph Siedentop "] edition = "2018" license = "GPL-3.0" diff --git a/README.md b/README.md index cfcc178..b636509 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Git QuickFix -Quickfix allows you to commit changes in your git repository to a new branch +_Quickfix_ allows you to commit changes in your git repository to a new branch without leaving the current branch. ## Motivation @@ -15,8 +15,8 @@ the original branch. - Minimize context switching. - Much quicker on large repositories, where branch switching takes significant time. -- Everything happens in memory, so tools watching the file system will not get - confused. +- Everything happens in memory, so tools and IDEs watching the file system will + not get confused. ## How it works @@ -37,11 +37,8 @@ the original branch. branch. This is only safely possible if there are no local modifications. Add `--stash` if you have local changes that you want to temporarily stash. -The new commit and the new branch are both created in memory. This means your -working directory will not be modified. Unless `--keep` is provided, the staged -changes will be removed. - -You can also use the alias **qf**: `git qf`. +The cherry-pick is done in memory. This means your working directory will not be +modified. Unless `--keep` is provided, the quickfix commit will be removed. ## Installation @@ -54,10 +51,33 @@ cargo install git-quickfix ## Known Issues - Default branches from origin are picked up through a hard-coded list. Patches - welcome. - -### TODO + welcome. If the default branch on the remote is not called main, master or + devel, you have to supply it manually. Similarly, if the remote is not called + 'origin' similar issues will occur. Please [create an issue][ticket] if this + bothers you. -- Add Github action -- `--push` currently use the Shell to push the changes. Benefits: All proxy, +- Won't fix: `--push` use the shell to push the changes. Benefits: All proxy, auth and other configs are picked up. But if does not feel right. + +[ticket]: https://github.com/siedentop/git-quickfix/issues/new/choose + +## FAQ + +- _Can it handle multiple commits?_ -- No. I am trying to keep the tool simple. + However, I originally started with this. If you see a need, please [create a + feature request][ticket]. +- _Are commit hooks_ considered? -- Not really. While the original commit will + have pre- and post-commit hooks run, the cherry-pick itself does not run the + pre-commit hook. As far as I understand, this may be the git [behavior][1], or + maybe [not][2]? None of it matters, as libgit2 does [not support][3] hooks. If + you have a use for a particular git-hook, please create a [new + ticket][ticket]. +- _How does this work?_ -- _libgit2_ provides a raw cherry-pick method. This + works in-memory, meaning that the working directory (i.e. the checked out + files) can be left untouched. This method returns a raw Index object, which I + use to create a new commit. + +[1]: http://git.661346.n2.nabble.com/cherry-pick-pre-commit-hook-td5815961.html +[2]: + https://public-inbox.org/git/CAPig+cTT11J00aRO1gO06O6j5zdf4y6XRJhG5X7ZFeP6n7TOGQ@mail.gmail.com/T/ +[3]: https://github.com/libgit2/libgit2/issues/964