A command line tool allowing for easy shifting between git identities (username, email, and signing key (e.g. GPG)).
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Luiserebii df1e97daa5
Minor update for logo on README.md
2 weeks ago
.circleci Correcting config.yml 3 weeks ago
extra Aha! Found the bug thanks to GDB, the sizeof() is what was giving us +1 than we expected. Documenting this in an image file just for future reference, a debugger is honestly very handy 4 weeks ago
include Added saferealloc and swapped it in for realloc in vector 2 weeks ago
lib Ended up having to implement algorithm_find_last, haha. Found error in documentation for algorithm_find as well; may be worth pushing upstream to C-STL 3 weeks ago
scripts Adding lint.sh script, .clang-format, and LICENSE 4 weeks ago
src Added saferealloc and swapped it in for realloc in vector 2 weeks ago
test Attempting to be more correct regarding const 2 weeks ago
.clang-format Adding lint.sh script, .clang-format, and LICENSE 4 weeks ago
.gitattributes Updating README.md, adding .gitattributes 4 weeks ago
.gitignore Ok, neat, appears our setup is working 3 weeks ago
LICENSE Adding lint.sh script, .clang-format, and LICENSE 4 weeks ago
Makefile Adding explicit void to function parameters, and adding -Wstrict-prototypes to check for it (declaring without params means any, best to be explicit in this case) 2 weeks ago
README.md Minor update for logo on README.md 2 weeks ago

README.md

gitid

gitid-logo

GitHub CircleCI Codacy Badge

A command line tool allowing for easy shifting between git identities (username, email, and signing key (e.g GPG)). A lighter, more portable rewrite of git-identity in C.

Usage

Usage: gitid [-valch] [-s <id-name>] [-n <id-name>] [-u <id-name>] [-d <id-name>] [--global] [--local] [--user=<username>] [--email=<email>] [--sigkey=<sigkey>]
A command line tool allowing for easy shifting between git identities (username, email, and signing key).

  -v, --version             output the version number
  -a, --about               about this tool
  -l, --list                list all registered identities
  -c, --current             current global git identity
  -s, --shift=<id-name>     shift git identity to registered identity (global by default)
  -n, --new=<id-name>       add new identity
  -u, --update=<id-name>    update registered identity
  -d, --delete=<id-name>    delete registered identity
  -h, --help                display this help and exit

Additional flags:

-c, --current, --s, --shift:
  --global                  refer to global git config
  --local                   refer to local git config (repository-level)

-n, --new, -u, --update:
  --user=<username>         specify username
  --email=<email>           specify email
  --sigkey=<sigkey>         specify signing key (key-id format: LONG)

Building

Building is very simple, simply run make, and it’ll produce an executable gitid.

Installation

Linux

To install, simply extract the tool into a preferred directory, build, and create a soft link. For example, if you are looking to place the tool in your home directory:

unzip gitid-0.2.1-alpha.zip -d ~/
cd ~/gitid-0.2.1-alpha
make
sudo ln -s ~/gitid-0.2.1-alpha/gitid /usr/local/bin/gitid

Doing this should make it globally accessible via gitid.

Testing

Run make && ./a.out in the test/ directory to run all tests. For simplicity, some tests are not automated, and ask for runner confirmation to ensure that the output is valid (e.g. gitid_id_min_write).

To easily confirm this output, an additional script has been added to the test makefile. Simply run make out to execute.

License

This code has been licensed under the GNU General Public License v3.0.