Skip to content
This repository has been archived by the owner on Nov 25, 2022. It is now read-only.

Add helper aliases #66

Closed
salcode opened this issue Jan 15, 2018 · 1 comment
Closed

Add helper aliases #66

salcode opened this issue Jan 15, 2018 · 1 comment

Comments

@salcode
Copy link
Member

salcode commented Jan 15, 2018

While working in #65 and the complexity there, it occurred that it may be helpful to have a number of small commands, which we can then use when building bigger commands.

e.g.

  • get last branch name
  • get tracking remote origin based on local branch name
  • get tracking remote branch based on local branch name
  • check if branch has tracking remote
@salcode
Copy link
Member Author

salcode commented Jan 15, 2018

The following all seem like they could be helpful. We're currently prefixing these since the thought is these wouldn't generally be used directly (and if we want to use them directly, we may want to create a shorter alias to them).

FeCurrentBranchName                   = rev-parse --abbrev-ref HEAD
FePreviousBranchName                  = rev-parse --symbolic-full-name --abbrev-ref @{-1}

# These each take one parameter (`$1`), which is the local branch name we want to use.
FeTrackingRemoteByLocalBranchName     = "!f() { git "config branch.$1.remote"; }; f"
FeTrackingBranchNameByLocalBranchName = "!f() { git "config branch.$1.merge"; }; f"

salcode added a commit that referenced this issue Jan 15, 2018
By adding these helper aliases, they simplify writing other more complex aliases.

- FeCurrentBranchName
- FePreviousBranchName
- FeTrackingRemoteByLocalBranchName
- FeTrackingBranchNameByLocalBranchName

See #66
salcode added a commit that referenced this issue Jan 15, 2018
By adding these helper aliases, they simplify writing other more complex aliases.

- FeCurrentBranchName
- FePreviousBranchName
- FeTrackingRemoteByLocalBranchName
- FeTrackingBranchNameByLocalBranchName

See #66
salcode added a commit that referenced this issue Jan 15, 2018
@salcode salcode closed this as completed Jan 15, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant