Showing heading of the section following the hunk range in internal diff viewer

Hello,

Is the custom action required to achieve this output in the internal diff viewer?

Can't quite get the internal diff viewer to show the (optional) heading of the section that shows function that the hunk is part of, following the hunk range.

Is this showing of the function that the hunk is part of, even possible with current version of Sourcetree, 1.5.2.0 ?

Thanks much.

4 answers

Bump. Help... :(

Hi George,

Could you re-phrase your original question. I'm not understanding what you're getting at.

Cheers.

Hello, in the SourceTree in Log/History view, right side is a diff pane.

In a given diff output, one sees the following as an example:

Hunk 1 : Lines 3-15 (previously 3-14)
...
... dif output
...

That's good and all, but how do i show the diff heading that looks like following with the heading of the diff section that shows the function that the diff is part of ?

index b1d597c..1097bf4 100644
--- a/src/foo.c
+++ b/src/foo.c
@@ -1809,6 +1809,7 @@ blah42_routine(char** argv,
...
... dif output
...

Bump. Did the above info help to clarify the original question? Thanks.

It did for me, I've never noticed that feature of git diff before, but it's pretty awesome.

Unfortunately, I don't think any existing options (including custom actions) are going to achieve what you want. File a feature request on jira.atlassian.com, then post a link here so I (and anyone else who is interested) can vote for it.

Hey George. We parse out the diff in order to generate the diff view. We don't expose any of these options, you'd have to do a Git call to get them :)

It sounds like George wants SourceTree to parse the code being displayed in the diff so that method signatures would be included in the context. For example, a hunk would look like:

...
function MyFunction() {
...
//precontext line 3
//precontext line 2
//precontext line 1
/*
diffed lines
*/
//postcontext line 1
//postcontext line 2
//postcontext line 3
...

I expect most people would understand that the proposed feature is far too complex to implement reliably, especially in languages that allow nested functions. However, if you were able to implement this for even some languages, it would be incredibly helpful/cool.

Yes, showing the method signature like it's shown in the "git diff" output.

Okay, so perhaps SourceTree isn't just using git diff under the hood.

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Posted 6 hours ago in Off-topic

Miscellaneous Monday - CreatatronV3

You may remember, not so long ago, that together we invented the most evil of machines: The Destructo5000!  The effects of missing Durian rippled over nations. Complete chaos as goat chee...

55 views 4 2
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you