Skip to content
This repository has been archived by the owner on Sep 11, 2020. It is now read-only.

Support for git blame options #211

Open
olivierbeaulieu opened this issue Jan 16, 2017 · 4 comments
Open

Support for git blame options #211

olivierbeaulieu opened this issue Jan 16, 2017 · 4 comments

Comments

@olivierbeaulieu
Copy link

I am looking to run a git blame using gogit, however I would like to use the option -w and -M to respectively ignore whitespace changes, and follow moved/copied code.

These options don't currently seem available, are they planned to be included in the v4 release?

@alcortesm
Copy link
Contributor

Hi Olivier!

Sorry, these options are not planned to be included in the v4 release.

Right now, the only planned modification to blame will be fixing the performance problems described in https://github.com/alcortesm/git-diff-tree-benchmarks. As you can see, our main focus now is making simple blames faster.

PR are welcome though: if you want more complicated diffs/blames, we will happily add them to our code base, as long as simple blames remain fast.

@olivierbeaulieu
Copy link
Author

Cool, thanks for the fast response. Follow-up question regarding git blame (not sure if it really warrants a separate issue) - BlameResult is of type []*line. Further, line is:

type line struct {
	author string
	text   string
}

I'm trying to access the name of the author for a specific line, but it's all private. Is there a specific reason why it was designed this way? I'm only getting started with Go, so I might be missing something here.

@alcortesm
Copy link
Contributor

line and its fields are private because we are not using them right now for anything and we try to keep the API as small as possible.

But of course, you are rigth, they should be public if we want to use them for anything useful.

#213 fixes this.

@olivierbeaulieu
Copy link
Author

Wonderful, thanks!

gsalingu-ovhus pushed a commit to gsalingu-ovhus/go-git that referenced this issue Mar 28, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants