-
-
Notifications
You must be signed in to change notification settings - Fork 208
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
Linked worktrees do not show changes #1052
Comments
Thanks for opening your first issue at git-cliff! Be sure to follow the issue template! ⛰️ |
Hello 👋🏼 Thanks for reporting.
Interesting use case! I think I have never run into this before. For convenience we added a directory detection mechanism for monorepos in #969 - I guess that's not compatible when you use worktrees. One question though, does I guess the possible solution would be to check worktrees via calling |
@orhun, it does work when running from the main worktree.
👆🏻 Running inside of any of these linked worktrees does not work, running inside of the main does. The So I'm thinking something here (and I'll state for posterity that I am not a Rust guy): pub fn path(&self) -> PathBuf {
let mut path = self.inner.path().to_path_buf();
if path.ends_with(".git") {
path.pop();
}
path
} And here: // Include only the current directory if not running from the root repository
let mut include_path = args.include_path.clone();
if let Some(mut path_diff) =
pathdiff::diff_paths(env::current_dir()?, repository.path())
{
if include_path.is_none() && path_diff != Path::new("") {
info!(
"Including changes from the current directory: {:?}",
path_diff.display()
);
path_diff.extend(["**", "*"]);
include_path =
Some(vec![Pattern::new(path_diff.to_string_lossy().as_ref())?]);
}
} Is treating the worktree like a subdirectory of the main directory and it ends up looking for |
To be clear, this works as expected in v2.7.0 |
Thanks for the info, I took a stab at fixing this in #1054 - it seemed to work fine to me locally. Could you also build from source and test it out if you have the chance? |
Yup, everything appears to be working. |
Awesome, thanks for testing! |
Is there an existing issue for this?
Description of the bug
When running
git cliff
from a linked worktree, instead of outputting changes I instead get:I suspect the changes in
git-cliff/src/lib.rs
lines 216–229 are the culprit.Steps To Reproduce
Create a linked worktree and run
git cliff
orgit-cliff
Expected behavior
Should output a list of changes against the main branch.
Screenshots / Logs
No response
Software information
Additional context
No response
The text was updated successfully, but these errors were encountered: