Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Skip all tags, when skip_tags = "" #63

Closed
hituzi-no-sippo opened this issue Feb 19, 2022 · 2 comments
Closed

Skip all tags, when skip_tags = "" #63

hituzi-no-sippo opened this issue Feb 19, 2022 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@hituzi-no-sippo
Copy link

hituzi-no-sippo commented Feb 19, 2022

I'm sorry if the behavior this is a specification.

Describe the bug

Skip all tags, when skip_tags = "".
Is this the expected behavior?

To Reproduce

I've created a test script.

test script
#!/bin/bash
set -e

rm -rf /tmp/cliff/skip_tags_test
mkdir -p /tmp/cliff/skip_tags_test
cd /tmp/cliff/skip_tags_test

git init

git commit --allow-empty -m "chore: v0.0.1"
git tag v0.0.1

git commit --allow-empty -m "feat: v0.1.0-beta.1"
git tag v0.1.0-beta.1

git commit --allow-empty -m "feat: v0.1.0"
git tag v0.1.0

git cliff --init

echo '====================================='
echo 'skip_tags = "v0.1.0-beta.1" (Default)'
echo '====================================='
git cliff

sed -i 's/\(skip_tags = \)"v0.1.0-beta.1"/\1""/' cliff.toml
echo '====================================='
echo 'skip_tags = ""'
echo '====================================='
git cliff

sed -i 's/skip_tags.*//' cliff.toml
echo '====================================='
echo 'skip_tags is unset.'
echo '====================================='
git cliff
output
Initialized empty Git repository in /tmp/cliff/skip_tags_test/.git/
[main (root-commit) c57e04c] chore: v0.0.1
[main fe30e5e] feat: v0.1.0-beta.1
[main 9492956] feat: v0.1.0
 INFO  git_cliff > Saving the configuration file to "cliff.toml"
=====================================
skip_tags = "v0.1.0-beta.1" (Default)
=====================================
# Changelog

All notable changes to this project will be documented in this file.

## [0.1.0] - 2022-02-19

### Features

- V0.1.0

## [0.0.1] - 2022-02-19

### Miscellaneous Tasks

- V0.0.1

<!-- generated by git-cliff -->
=====================================
skip_tags = ""
=====================================
# Changelog

All notable changes to this project will be documented in this file.

<!-- generated by git-cliff -->
=====================================
skip_tags is unset.
=====================================
# Changelog

All notable changes to this project will be documented in this file.

## [0.1.0] - 2022-02-19

### Features

- V0.1.0

## [0.1.0-beta.1] - 2022-02-19

### Features

- V0.1.0-beta.1

## [0.0.1] - 2022-02-19

### Miscellaneous Tasks

- V0.0.1

<!-- generated by git-cliff -->

skip_tags = ""

# Changelog

All notable changes to this project will be documented in this file.

<!-- generated by git-cliff -->

Expected behavior

I expect don't skip all tags, as when skip_tags is unset.

skip_tags is unset.

# Changelog

All notable changes to this project will be documented in this file.

## [0.1.0] - 2022-02-19

### Features

- V0.1.0

## [0.1.0-beta.1] - 2022-02-19

### Features

- V0.1.0-beta.1

## [0.0.1] - 2022-02-19

### Miscellaneous Tasks

- V0.0.1

<!-- generated by git-cliff -->

System (please complete the following information):

Additional context

Code that may be relevant.

let skip_regex = config.git.skip_tags.as_ref();
let ignore_regex = config.git.ignore_tags.as_ref();
tags = tags
.into_iter()
.filter(|(_, name)| {
// Keep skip tags to drop commits in the later stage.
let skip = skip_regex.map(|r| r.is_match(name)).unwrap_or_default();

I have changed to the following code.

let skip = skip_regex.map(|r| r.is_match(name)).unwrap_or_default();
println!("{}", skip);

println!("{}", skip); output true always, when skip_tags = "".

Thank you.

@hituzi-no-sippo hituzi-no-sippo added the bug Something isn't working label Feb 19, 2022
@hituzi-no-sippo hituzi-no-sippo changed the title Skip all tags, when skip_tags = "". Skip all tags, when skip_tags = "" Feb 19, 2022
@orhun
Copy link
Owner

orhun commented Feb 19, 2022

Hey, good catch! It should be fixed in ff1d981 🐻

@hituzi-no-sippo
Copy link
Author

Good job 👍

I've checked, it worked as expected.
Thank you 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants