Skip to content

Commit

Permalink
Merge branch 'release/1.3.10' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
Serhioromano committed May 25, 2022
2 parents c43d6bd + 6177b13 commit 6a0f908
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 15 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

All notable changes to the "gitflow" extension will be documented in this file.

## [1.3.10] 05/25/2022

- add - Option to automatically bump version on release or not.

## [1.3.9] 05/18/2022

- add - replace spaces in branch name with `_`
Expand Down
25 changes: 17 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,23 +51,31 @@ All basic operations you need to do in a single place.
- Quick Pick menu (use `Shift`+`Alt`+`D`)
- All commands results are outputted in output window named `Git Flow`. There is a parameter that also allow to show all internal `git` commands run inside `git flow`.

#### Multiple Folder Workspace
### Options

- `gitflow.showAllCommands` - This option allows to see in GitFlow output window underground git commands run by git-flow.
- `gitflow.path` - Allow manually set path for Git Flow executable including `flow`. For instance `/usr/bit/git flow`.
- `gitflow.autoBumpVersion` - Either it should automatically bump a version in `package.json` file on `feature` or `hotfix` creation, and commit it to git.

## Feature Details

### Multiple Folder Workspace

Multiple folder workspace was long awaited feature of VS Code for many people. It would be a shame not to support it.

![Gitflow multiple folder workspace](https://raw.githubusercontent.com/Serhioromano/vscode-gitflow/main/resources/media/mfw.png)

#### Quick Pick
### Quick Pick

Quick Pick is a popup with essential Git Flow commands, like creating a new flow branch or appling actions to the currently selected flow brunch. You can call it with `Shift`+`Alt`+`d` short key. Note this command is available only if extension was initialized successfully.

![Git flow quick pik](https://raw.githubusercontent.com/Serhioromano/vscode-gitflow/main/resources/media/qp.png)

#### Automatic version bump
### Automatic version bump

This extension can automatically update your `package.json` file on creating a new tag - but only on `release` and `hotfix` branches. When you create one, as a name use version standard. For example create a `1.0.1` release which will result in a `release/1.0.1` branch. The `version` property of `package.json` will be updated to `1.0.1` and automatically committed to git.

#### Automatic changelog update
### Automatic changelog update

This extension can automatically update your `CHANGELOG.md`. If you have there something like

Expand All @@ -81,9 +89,9 @@ or

Or any combination of `[Unreleased]`, `[unreleased]`, `[UNRELEASED]`, `yyyy`, `mm` or `dd` and all uppercase variations, these will be replaced with the relevent info.

## How to work with Support branch
### How to work with Support branch

### What is Git Flow Support branch for?
#### What is Git Flow Support branch for?

Support branches are similar to LTS version of Linux distros.

Expand All @@ -93,7 +101,7 @@ Say you had a project, and you were happily releasing new versions. Maybe your c

For this to happen you have to create `support/6.0` at some point of time. Basically you can create support branch on all major version change.

### Workflow
#### Workflow

First create your support branch. When you create you can select the tag version to start from. Use the latest version in major set.

Expand Down Expand Up @@ -163,7 +171,8 @@ GitHub CLI will automatically store your Git credentials for you when you choose

## Changelog

- 1.3.9
- 1.3.10
- add - Option to automatically bump version on release or not.
- add - replace spaces in branch name with `_`
- fix - tmp dir for message files on release and hotfix
- add - parameter `gitflow.path` to manually set gitflow executable.
Expand Down
7 changes: 6 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "vscode-gitflow",
"displayName": "Git Flow",
"description": "Git-Flow support for VS Code",
"version": "1.3.9",
"version": "1.3.10",
"engines": {
"vscode": "^1.64.0"
},
Expand Down Expand Up @@ -60,6 +60,11 @@
"type": "string",
"default": "",
"description": "Set you git-flow path manually"
},
"gitflow.autoBumpVersion": {
"type": "boolean",
"default": true,
"description": "Bump package version post start release/hotfix."
}
}
},
Expand Down
13 changes: 7 additions & 6 deletions src/ViewBranches.ts
Original file line number Diff line number Diff line change
Expand Up @@ -467,10 +467,8 @@ export class TreeViewBranches implements vscode.TreeDataProvider<Flow> {
break;
}

let command =
vscode.workspace.getConfiguration("gitflow").get("showAllCommands") === true
? " --showcommands "
: " ";
let config = vscode.workspace.getConfiguration("gitflow");
let command = config.get("showAllCommands") === true ? " --showcommands " : " ";
let cmd = `${this.util.flowPath} ${feature} ${what}${command}${option} ${name} ${base}`;
console.log(cmd);

Expand All @@ -479,7 +477,10 @@ export class TreeViewBranches implements vscode.TreeDataProvider<Flow> {
if (["hotfix", "release"].includes(feature)) {
vscode.commands.executeCommand("gitflow.refreshT");
}
if (["hotfix", "release"].includes(feature) && exist && what === 'start') {

// Bump version
const shouldBumpVersion = config.get("autoBumpVersion");
if (shouldBumpVersion && ["hotfix", "release"].includes(feature) && exist && what === 'start') {
version =
JSON.parse(readFileSync(this.util.workspaceRoot + "/package.json", "utf8")).version ||
"";
Expand All @@ -492,7 +493,7 @@ export class TreeViewBranches implements vscode.TreeDataProvider<Flow> {
)
);
this.util.execSync(`"${this.util.path}" add ./package.json`);
this.util.execSync(`"${this.util.path}" commit ./package.json -m"Version bump"`);
this.util.execSync(`"${this.util.path}" commit ./package.json -m "Version bump to ${name}"`);
}
}
});
Expand Down

0 comments on commit 6a0f908

Please sign in to comment.