|
8 | 8 |
|
9 | 9 | CommitPrefix is a simple command line tool that helps you to easily prefix your commit messages. The common use case for this is tagging your commit messages with a Jira (or other issue tracking software) ticket number. The desired prefix is stored within the .git folder and picked up by a generated commit-message hook. This allows you to write your ticket number (or any other prefix) once. From then on all commit messages will be prepended with the saved prefix. |
10 | 10 |
|
| 11 | +There's also a branch parse mode that allows commitPrefix to parse the current branch you're on for a valid issue numbers and use them as prefixes for your next commit. The modes can be switched back and forth arbitrarily and used along with any self defined prefixes. |
| 12 | + |
11 | 13 | Prefixes can be re-assigned or deleted at any time. Additionally, this is a git repository specific tool, meaning that stored prefixes are specific to the repository you're in. |
12 | 14 |
|
13 | 15 | The actions that can be done are: |
14 | 16 |
|
15 | | -* Store a commit prefix |
16 | | -* Delete the currently stored prefix |
17 | | -* View the currently stored prefix |
| 17 | +* Store an arbitrary number of commit prefixes |
| 18 | +* Generate prefixes based on your current branch |
| 19 | +* Delete the currently stored prefixes |
| 20 | +* View the current mode and stored prefixes |
18 | 21 |
|
19 | 22 | ___ |
20 | 23 | ### -- Installation -- |
@@ -68,26 +71,45 @@ To use commitPrefix you need to have your working directory set to one that has |
68 | 71 |
|
69 | 72 | To **store** a prefix |
70 | 73 | ```zsh |
71 | | -% commitPrefix SamplePrefix-001 |
| 74 | +% commitPrefix SamplePrefix-001,SamplePrefix-002 |
| 75 | + |
| 76 | +# Output |
| 77 | +CommitPrefix STORED [SamplePrefix-001][SamplePrefix-002] |
| 78 | +``` |
| 79 | + |
| 80 | +To change mode to **branchParse** |
| 81 | +```zsh |
| 82 | +% git checkout ENG-342-SomeFeatureBranchLinkedToENG-101 |
| 83 | +% commitPrefix -b eng |
| 84 | + |
| 85 | +# Output |
| 86 | +CommitPrefix MODE BRANCH_PARSE eng |
| 87 | +``` |
| 88 | + |
| 89 | +To **view** the current prefixes and mode |
| 90 | +```zsh |
| 91 | +% commitPrefix |
72 | 92 |
|
73 | 93 | # Output |
74 | | -CommitPrefix saved: [SamplePrefix-001] |
| 94 | +CommitPrefix MODE BRANCH_PARSE |
| 95 | +- branch prefixes: [SamplePrefix-001][SamplePrefix-002] |
| 96 | +- stored prefixes: [ENG-342][ENG-101] |
75 | 97 | ``` |
76 | 98 |
|
77 | | -To **view** a prefix |
| 99 | +To change back to **normal** mode |
78 | 100 | ```zsh |
79 | | -% commitPrefix --view |
| 101 | +% commitPrefix -n |
80 | 102 |
|
81 | 103 | # Output |
82 | | -CommitPrefix: [SamplePrefix-001] |
| 104 | +CommitPrefix MODE NORMAL |
83 | 105 | ``` |
84 | 106 |
|
85 | 107 | To **delete** a prefix |
86 | 108 | ```zsh |
87 | | -% commitPrefix --delete |
| 109 | +% commitPrefix -d |
88 | 110 |
|
89 | 111 | # Output |
90 | | -CommitPrefix Deleted |
| 112 | +CommitPrefix DELETED |
91 | 113 | ``` |
92 | 114 |
|
93 | 115 | You can also view these command along with shortend version by using the `--help` tag. |
0 commit comments