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

Ignore commits that move a file #123

Open
AckslD opened this issue Feb 17, 2024 · 7 comments
Open

Ignore commits that move a file #123

AckslD opened this issue Feb 17, 2024 · 7 comments
Labels
enhancement New feature or request

Comments

@AckslD
Copy link
Contributor

AckslD commented Feb 17, 2024

I recently learned about the -C flag of git blame which can be added 0 to 3 times and make eg commits that just move away to be ignored. This is usually what I actually want to see and I was wondering if it could make sense to expose that as a configuration option or an option to the command directly?

@f-person
Copy link
Owner

Oh, hi!

which can be added 0 to 3 times

Could you expand a bit on this one?

if it could make sense to expose that as a configuration option or an option to the command directly

Yeah, this seems to make sense initially.

@marcelarie
Copy link

marcelarie commented Feb 19, 2024

I am interested in this feature too.

Could you expand a bit on this one?

All the information that I have is from an article on Git Butler, but in resume, The -C option ignores code movements between files or lines when using the git blame command. It only shows changes to the code itself, rather than movements.

Example where in the first command uses a normal git blame and in the second it used git blame -C -C -C:
image

here the article:
https://blog.gitbutler.com/git-tips-1-theres-a-git-config-for-that/#git-blame-with-following

@marcelarie
Copy link

marcelarie commented Feb 19, 2024

I think that for the plugin, a nice feature will be to add the parameters that we want to add to the git blame command.

For example:

let g:gitblame_parameters = ['-w', '-C', '-C', '-C']

and then this should run as:

git blame -w -C -C -C

@AckslD
Copy link
Contributor Author

AckslD commented Feb 19, 2024

Thanks @marcelarie, I also got this tip from a very similar source, in a recent talk by the Scott from git butler:
https://www.youtube.com/watch?v=aolI_Rz0ZqY
(at ~11:50).

I think a setting could be nice but maybe also the ability to pass flags to eg GitBlameToggle and then you can do eg:

:GitBlameToggle -w -C

or similar. Not sure exactly how that should interact with default options though?

@marcelarie
Copy link

Yes that sounds amazing.
btw I think the article is from Scott too.

@f-person
Copy link
Owner

Thanks for the explanation @marcelarie!

I think that for the plugin, a nice feature will be to add the parameters that we want to add to the git blame command.

Yup, I agree it would be nice! However, for this particular one, I'd also like it to be a setting so that people can see that they can do this :)
(maybe even make this default..? 🤔)

I think a setting could be nice but maybe also the ability to pass flags to eg GitBlameToggle

I don't mind having that but don't think it's as important :)

@f-person f-person added the enhancement New feature or request label Feb 25, 2024
@agusdmb
Copy link

agusdmb commented Nov 27, 2024

i would love to have this too as it is how i have fugitive configured!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants