Skip to content

Commit

Permalink
docs: write documentation for release 0.8.0 (#141)
Browse files Browse the repository at this point in the history
  • Loading branch information
purpleclay authored Sep 19, 2023
1 parent 18e1b4c commit d5e2ff9
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 7 deletions.
1 change: 0 additions & 1 deletion docs/git/fetch.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
---
icon: material/clipboard-arrow-left-outline
status: new
title: Fetching the latest changes from a remote
description: Fetch all changes from a remote without integrating them into the current working directory
---
Expand Down
3 changes: 1 addition & 2 deletions docs/git/pull.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
---
icon: material/arrow-left-bold-box-outline
status: new
title: Pulling the latest changes from a remote
description: Pull all changes from a remote and integrate them into the current working directory
---
Expand Down Expand Up @@ -58,7 +57,7 @@ Fast-forward
create mode 100644 folder/c.txt
```

## Configuring fetch behavior :material-new-box:{.new-feature title="Feature added on the 21st of August 2023"}
## Configuring fetch behavior

When pulling changes from a remote repository, a fetch happens before merging any changes. Configuring the behavior of this fetch is possible using the supported `WithFetch...` [options](./fetch.md).

Expand Down
35 changes: 34 additions & 1 deletion docs/git/tag.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,43 @@ created tag 0.1.0
associated commit message
```

### Creating a local tag :material-new-box:{.new-feature title="Feature added on the 21st of August 2023"}
### Creating a local tag

Use the `WithLocalOnly` option to prevent a tag from being pushed back to the remote.

### Tagging a specific commit :material-new-box:{.new-feature title="Feature added on the 19th of September 2023"}

Use the `WithCommitRef` option to ensure a specific commit within the history is tagged.

### Batch tagging :material-new-box:{.new-feature title="Feature added on the 19th of September 2023"}

By calling `TagBatch`, a batch of tags can be created. `gitz` will enforce the `WithLocalOnly` option before pushing them to the remote in one transaction.

```{ .go .select linenums="1" }
package main

import (
"log"

git "github.com/purpleclay/gitz"
)

func main() {
client, _ := git.NewClient()

_, err := client.TagBatch([]string{"1.0.0", "1.0", "1"})
if err != nil {
log.Fatal("failed to batch tag repository")
}
}
```

A batch of tags that target specific commits can also be created by calling `TagBatchAt`. `gitz` will enforce the `WithLocalOnly` and `WithCommitRef` options before pushing them back to the remote in one transaction.

```{ .go .no-select linenums="1" }
client.TagBatchAt([]string{"0.1.0", "740a8b9", "0.2.0", "9e7dfbb"})
```

## Retrieving all tags

Calling `Tags` will retrieve all tags from the current repository in ascending lexicographic order:
Expand Down
5 changes: 2 additions & 3 deletions docs/testing/git-test.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
icon: material/test-tube
title: Testing your interactions with git
description: A dedicated package for testing your interactions with git
status: new
---

# Testing your interactions with git
Expand Down Expand Up @@ -165,7 +164,7 @@ func TestInitRepositoryWithStagedFiles(t *testing.T) {
}
```

### With committed files :material-new-box:{.new-feature title="Feature added on the 21st of August 2023"}
### With committed files

Create a set of files that will be committed to the repository using the `WithCommittedFiles` option. A single commit of `include test files` will be created.

Expand All @@ -188,7 +187,7 @@ func TestInitRepositoryWithCommittedFiles(t *testing.T) {
}
```

### With file content :material-new-box:{.new-feature title="Feature added on the 21st of August 2023"}
### With file content

Allows files created with the `WithFiles`, `WithStagedFiles` or `WithCommittedFiles` options to be overwritten with user-defined content. Key value pairs must be provided to the `WithFileContent` option when overriding existing files.

Expand Down

0 comments on commit d5e2ff9

Please sign in to comment.