Commit Graph

37 Commits

Author SHA1 Message Date
Martin Frost bb38091506 Update README with brew installation instructions
Co-authored-by: Maria Hansson <mariahansson92@hotmail.com>
2021-08-20 22:18:49 +02:00
Martin Frost 95adc9a16d Build packages on branches that start with build-
Co-authored-by: Maria Hansson <mariahansson92@hotmail.com>
2021-08-20 21:07:06 +02:00
Martin Frost 579a9d0ad4 Disable default-features for git2
The git2 default-features all have to do with ssh or ssh-keys. Those
require OpenSSL, which seems to be a bit tricky to get to compile
properly when cross-compiling on CI.

Also, since this project does not need those parts of the git2
dependency, we should be able to safely disable those features.

Co-authored-by: Maria Hansson <mariahansson92@hotmail.com>
2021-08-20 21:07:06 +02:00
Martin Frost e2d54e40ff Add note about binary packages to README 2021-08-20 17:12:17 +02:00
Martin Frost 1971673660
Merge pull request #1 from Frost/ci
Add CI workflow for linting and tests
2021-08-18 23:23:44 +02:00
Martin Frost b5757b3feb Remove TravisCI config 2021-08-18 23:20:17 +02:00
Martin Frost 4061981c4b Build artifacts when on main
This makes it easier for everyone to install git-mob and friends, since
they don't have to compile it themselves anymore.
2021-08-18 23:20:17 +02:00
Martin Frost fe1c91cfa5 Fix format 2021-08-18 23:20:02 +02:00
Martin Frost 9d09b31602 Fix needless-borrow 2021-08-18 23:20:02 +02:00
Martin Frost a97e37a9f3 Use &str instead of &String
We don't need a new object here, a slice is fine.
2021-08-18 23:20:02 +02:00
Martin Frost 79b73ee75c Add CI workflow for linting and tests 2021-08-18 23:20:02 +02:00
Martin Frost e60fae7031 v0.3.4 - Print correct main author
This change makes `get_main_author` try to fetch `user.name` and
`user.email` from the current repo before falling back to a global
default.

Co-authored-by: Maria Hansson <mariahansson92@hotmail.com>
2020-11-10 13:35:45 +01:00
Martin Frost 4575605991 v0.3.3 - Ensure commit.template is set
We currently ensure this by simply overriding any existing template.

This is of course sub-optimal, but the previous recommendation, to
globally set `commit.template` to a relative path would otherwise make
`git commit` crash when run in a repo without first creating that
template file, e.g. by running `git mob ...` or `git solo` in the
project directory before committing anything.

This way, we don't have to globally set `commit.template`, and git-mob
will still work.
2020-10-24 18:21:32 +02:00
Martin Frost 20997a0605 Rustfmt everything 2020-09-05 16:07:58 +02:00
Martin Frost a5ff50fd1b v0.3.2 - Fix typo in README 2020-06-19 13:52:49 +02:00
Martin Frost f45943f7a9 Fix typo in readme 2020-06-19 13:51:48 +02:00
Martin Frost 6d8df997d6 v0.3.1
Mention `git config commit.template` in README.
2020-06-19 13:49:03 +02:00
Martin Frost 5f88d5a029 v0.3.0 - Override main author
This change allows the `-o <initials>` flag to override who the main
author of any commits in this repo will be going forward.

What this actually does, is that it modifies the Repository's config
file to change the `user.name` and `user.email` like this.

Running `git mob -o ae be` (given the corresponding authors have been
configured using `git add-coauthor`) is equivalent to doing:

    git config user.name "Alice Example"
    git config user.email "alice@example.com"
    git mob be # be being the initials of "Bob Example" <bob@example.com>
2020-06-19 13:38:04 +02:00
Martin Frost dc822cdcac Update lockfile dependencies 2020-06-19 13:38:04 +02:00
Martin Frost 15886667da Extract `with_git_repo_or_exit`
This function will come in handy when doing other actions with a git
repo, like when modifying a repository's config.
2020-06-19 13:23:56 +02:00
Martin Frost 747e19828c Wrap gitmessage template path in closure
Since the only thing the `repo` argument to `with_repo_or_exit` was used
for, was to extract the gitmessage template path from it, we can just do
that directly instead.
2020-05-24 13:48:51 +02:00
Martin Frost 67f3f6b9b0 Add installation instructions to README 2020-05-24 13:31:01 +02:00
Martin Frost 609cdf83d8 Add git-edit-coauthor command
It is now possible to edit the available co-authors, in case you
misspelled someone's name, or they change their email address, or
something.
2020-05-24 13:23:15 +02:00
Martin Frost 64f7a10cd1 Flesh out manifest with more info 2020-05-23 23:41:18 +02:00
Martin Frost ea0bfc785d Add TravisCI config 2020-05-23 23:41:18 +02:00
Martin Frost b246b04c5a Add README.md 2020-05-23 23:41:18 +02:00
Martin Frost 934405ad4b Tidy up write_coauthors_to_gitmessage_file
* Inline closure
* Do some actual error handling
2020-05-23 21:05:04 +02:00
Martin Frost e64c6d7b74 Tidy up git-solo 2020-05-23 21:04:51 +02:00
Martin Frost c69cc0a9bc git-delete-coauthor 2020-05-23 20:56:53 +02:00
Martin Frost 8e46759b0a git-add-coauthor 2020-05-23 20:56:53 +02:00
Martin Frost 7b65f8e7b7 Write selected co-authors to .git/.gitmessage 2020-05-23 20:56:32 +02:00
Martin Frost ee7c56e0a0 Extract with_repo_or_exit
This will run a given function in a git repo, or print an error message
and exit if the current working directory is not within a git repo.
2020-05-23 20:56:32 +02:00
Martin Frost 41908686ed Extract gitmessage_template_file_path to lib
This piece of code will be used in a variety of places, so let's put it
somewhere where we can easily share it.
2020-05-23 20:56:32 +02:00
Martin Frost de5af01d1f First draft of git-mob binary
It can:

* Parse the `~/.git-coauthors` file
* List available co-authors with --list
* Filter available co-authors given a list of initials, giving an error
  if no co-author matches a given initial
2020-05-23 20:56:32 +02:00
Martin Frost 0061c5b112 Move get_main_author -> lib.rs 2020-05-23 20:56:32 +02:00
Martin Frost 8032a08656 Add working version of git-solo
`git-solo` clears the `.git/.gitmessage` commit message template in the
current git repository.

If the current working directory is not within a git repository, it will
print `Not in a git repository` on stderr and exit.
2020-05-23 20:56:32 +02:00
Martin Frost 96d9ae2a48 Initial commit 2020-05-23 20:54:38 +02:00