Skip to content

Commit 7fe0650

Browse files
committed
[CPFeature-003][UpdateDocs] Updated the Read me with the new functionality
1 parent b8d3057 commit 7fe0650

File tree

1 file changed

+32
-10
lines changed

1 file changed

+32
-10
lines changed

README.md

Lines changed: 32 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,16 @@ ___
88

99
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.
1010

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+
1113
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.
1214

1315
The actions that can be done are:
1416

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
1821

1922
___
2023
### -- Installation --
@@ -68,26 +71,45 @@ To use commitPrefix you need to have your working directory set to one that has
6871

6972
To **store** a prefix
7073
```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
7292

7393
# 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]
7597
```
7698

77-
To **view** a prefix
99+
To change back to **normal** mode
78100
```zsh
79-
% commitPrefix --view
101+
% commitPrefix -n
80102

81103
# Output
82-
CommitPrefix: [SamplePrefix-001]
104+
CommitPrefix MODE NORMAL
83105
```
84106

85107
To **delete** a prefix
86108
```zsh
87-
% commitPrefix --delete
109+
% commitPrefix -d
88110

89111
# Output
90-
CommitPrefix Deleted
112+
CommitPrefix DELETED
91113
```
92114

93115
You can also view these command along with shortend version by using the `--help` tag.

0 commit comments

Comments
 (0)