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

Generates empty CHANGELOG #75

Closed
kaushalmodi opened this issue Apr 2, 2022 · 10 comments
Closed

Generates empty CHANGELOG #75

kaushalmodi opened this issue Apr 2, 2022 · 10 comments
Assignees
Labels
bug Something isn't working

Comments

@kaushalmodi
Copy link
Contributor

Describe the bug

I have tried all the different switches of git cliff but the output is always empty:

# Changelog

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

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

To Reproduce

Steps to reproduce the behavior:

  1. Download and extract git-cliff from https://github.com/orhun/git-cliff/releases/download/v0.6.1/git-cliff-0.6.1-x86_64-unknown-linux-musl.tar.gz and put it in PATH.
  2. git clone https://github.com/orhun/git-cliff
  3. cd git-cliff
  4. git cliff
  5. See this output
    # Changelog
    
    All notable changes to this project will be documented in this file.
    
    <!-- generated by git-cliff -->
  • I tried git cliff -r ., git cliff -r . -w ., git cliff -l, git cliff -u, git cliff HEAD~5.., but regardless, that output is the same as above.
  • I also tried moving my ~/.gitconfig temporarily thinking that something in there might be messing with this. But that didn't help either.

Expected behavior

I expected the git commit logs to be parsed by git-cliff.

Screenshots/Logs

image

System (please complete the following information):

  • OS Information: CentOS Linux 7.6.1810
  • Project Version: latest HEAD of this repo (0.6.1)

Additional context

  • git version 2.34.0
@kaushalmodi kaushalmodi added the bug Something isn't working label Apr 2, 2022
@kaushalmodi
Copy link
Contributor Author

I tried git-cliff using 3 install methods but I got the same outcome:

  1. Download + extract the musl tar.gz from GitHub Releases
  2. Clone this repo and CARGO_TARGET_DIR=target cargo build --release
  3. cargo install git-cliff

I think that leaves out my OS and git versions as variables here.

@orhun
Copy link
Owner

orhun commented Apr 2, 2022

Do you have TEMPLATE environment variable set to empty by any chance? It looks like git-cliff is using a blank template while generating the changelog.

Do any of the examples work? e.g. git cliff -c examples/minimal or git cliff -c config/cliff.toml

Also, can you run git-cliff with -vv option and share the output?

@kaushalmodi
Copy link
Contributor Author

Do you have TEMPLATE environment variable set to empty by any chance?

No, it is undefined.

Do any of the examples work? e.g. git cliff -c examples/minimal or git cliff -c config/cliff.toml

No, they give the same empty output.

Also, can you run git-cliff with -vv option

The debug info for -vv looks the same as -v.

and share the output?

image

@kaushalmodi
Copy link
Contributor Author

I noticed that the minimal example needed the .toml extension. With that, I get

image

But still no changelog.

@kaushalmodi
Copy link
Contributor Author

I also unset these env variables.. just in case.. LESS, PAGER, GIT_PAGER. That didn't help either.

@orhun
Copy link
Owner

orhun commented Apr 4, 2022

I'm having trouble reproducing this issue. Can you also share the version of libgit2? Maybe it is related.

Have you tried running git-cliff with another repository? Do you get the same result?

@orhun
Copy link
Owner

orhun commented Apr 4, 2022

Can you build git-cliff from source (cargo build) and share the output of target/debug/git-cliff --context?

@kaushalmodi
Copy link
Contributor Author

kaushalmodi commented Apr 4, 2022

Turns out that your latest commit 84507dd fixed this issue for me!

I had INCLUDE_PATH path set to point to some C header directory for GCC compilation. I am glad that you fixed above by prefixing GIT_CLIFF_...

(Related issue: #74)


The issue is now fixed, but I will answer your questions anyways.

Can you also share the version of libgit2? Maybe it is related.

I am using libgit2 that I built about 2 years back: libgit2/libgit2@66137ff6e (v1.1.0+)

Have you tried running git-cliff with another repository? Do you get the same result?

Yes. I was trying to run git cliff on your repo after it didn't work on any of mine 😄.

Can you build git-cliff from source (cargo build)

Now cargo build --release works as well.


Thanks!

@kaushalmodi
Copy link
Contributor Author

@orhun May I suggest that when the user uses -v (or may be -vv), you print all the environment variables and parsed git cliff CLI switch values that affect its output?

@orhun
Copy link
Owner

orhun commented Apr 5, 2022

Hey, I'm glad this issue is resolved by #76, wasn't expecting that 😄

@orhun May I suggest that when the user uses -v (or may be -vv), you print all the environment variables and parsed git cliff CLI switch values that affect its output?

Hmm, can you elaborate what you mean with an example? Actually, having a separate issue for tracking this would be great.

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