Skip to content

Instantly share code, notes, and snippets.

@burakcan
Created October 3, 2019 11:00
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save burakcan/d8d8b0119afeb1558e476a3d77ebff4c to your computer and use it in GitHub Desktop.
Save burakcan/d8d8b0119afeb1558e476a3d77ebff4c to your computer and use it in GitHub Desktop.
#ifndef SAFE_RANGE_USER
#define SAFE_RANGE_USER SAFE_RANGE
#endif
enum git_keycodes {
GIT_PULL = SAFE_RANGE_USER,
GIT_CHECKOUT_MASTER,
GIT_CHECKOUT_B,
GIT_PULL_REBASE_MASTER,
GIT_ADD_ALL,
GIT_COMMIT,
GIT_AMEND,
GIT_PUSH_U,
GIT_PUSH,
GIT_PUSH_FORCE,
GIT_STATUS
};
static const char * const git_macros[] = {
[GIT_PULL - GIT_PULL] = "git pull",
[GIT_CHECKOUT_MASTER - GIT_PULL] = "git checkout master",
[GIT_CHECKOUT_B - GIT_PULL] = "git checkout -b ",
[GIT_PULL_REBASE_MASTER - GIT_PULL] = "git pull --rebase origin master",
[GIT_ADD_ALL - GIT_PULL] = "git add --all",
[GIT_COMMIT - GIT_PULL] = "git commit -m \"\""SS_TAP(X_LEFT),
[GIT_AMEND - GIT_PULL] = "git commit --amend",
[GIT_PUSH_U - GIT_PULL] = "git push -u origin $(git rev-parse --abbrev-ref HEAD)",
[GIT_PUSH - GIT_PULL] = "git push",
[GIT_PUSH_FORCE - GIT_PULL] = "git push --force",
[GIT_STATUS - GIT_PULL] = "git status",
};
#undef SAFE_RANGE_USER
#define SAFE_RANGE_USER (GIT_STATUS + 1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment