GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Pull Request inline comment appears on GitHub.com but not in extension · Issue #1469 · github/VisualStudio

This repository was archived by the owner on Jun 21, 2023. It is now read-only.
This repository was archived by the owner on Jun 21, 2023. It is now read-only.

Pull Request inline comment appears on GitHub.com but not in extension #1469

Copy link
Copy link
Closed
Closed
Pull Request inline comment appears on GitHub.com but not in extension#1469
Copy link
Labels
bug

Description

@jcansdale
jcansdale
opened on Feb 8, 2018
Issue body actions
  • GitHub Extension for Visual Studio version: 2.4.1
  • Visual Studio version: All

What happened (with steps, logs and screenshots, if possible)

  1. Added inline comment using GitHub Extension: Ensure that the GitHubPaneViewModel is initalized. #1426 (review)
  2. Comment appears on PR page (possibly the line above where I added it, not sure)
  3. Open IPullRequestSessionManager.cs from PR details view
  4. Inline comment doesn't appear on diff view or PR file tree

image

Diagnosis

It appears the issue caused a dependency in the use of the git diff --indent-heuristic option. GitHub.com uses this but command line and libgit2 doesn't use it by default.

You can see the difference in the output from the following commands (on the github/VisualStudio repo):

git diff a39d0bb8..87058c77
git diff a39d0bb8..87058c77 --indent-heuristic

See here for when it was introduced:
https://github.com/github/experience-engineering-code/issues/483

Fix

The --indent-heuristic option is available in libgit:
https://github.com/libgit2/libgit2/blob/da8138b01217824cf211fa491608a7b067cf8e43/include/git2/diff.h#L134

But isn't currently available in libgit2sharp.

https://github.com/libgit2/libgit2sharp/blob/master/LibGit2Sharp/Core/GitDiff.cs#L191
Needs to learn about the new flag.

https://github.com/libgit2/libgit2sharp/blob/3f9b415fa1edfc31ce1ec2b4b3d18441c34adfff/LibGit2Sharp/Diff.cs#L21
Needs to know to set it.

We would need a DiffModifiers.IndentHeuristic bool

If you have a GitDiffOptions then you can turn on bit (1 << 31) of the Flags (which unfortunately we don't have access to). See libgit2/libgit2@7e3faf5

@ethomson said he might have a chance to tackle this on on a long flight tomorrow. It would be very much appreciated if he was able to! 😃

Update: it looks like this has changed to GIT_DIFF_INDENT_HEURISTIC = (1u << 18) in recent versions.
libgit2/libgit2@2d9d246

Activity

  1. jcansdale
    added
    bug
    on Feb 8, 2018
  2. jcansdale commented on Dec 14, 2018

    @jcansdale
    jcansdale
    on Dec 14, 2018
    CollaboratorAuthor
    More actions

    Here's a hacked version of LibGit2Sharp that should turn this on by default:
    LibGit2Sharp.zip

    The selected lined below have been added.

    image

    image

    Even with this patched version I can't add a comment on that line. 😭

    image

    I'll double check the fix and see if I'm missing something. 😕

    • It looks like Libgit2Sharp 0.23.1 is using LibGit2 0.25.1, which is before the version that includes the GIT_DIFF_INDENT_HEURISTIC option. 😭
    • Libgit2Sharp 0.24.1 is using LibGit2 0.26.2 (which also doesn't contain the option).
    • Targeting .NET 4.6.0 was removed here Remove the net40 target and other misc cleanup libgit2/libgit2sharp#1511
    • Recent versions of LibGit2Sharp target .NET 4.6.1 (Provide .NET 4.6.1 framework target libgit2/libgit2sharp#1606) which isn't compatible with Visual Studio

    You can see the difference by doing:

    git diff 8887a8..a39d0b --indent-heuristic -- src/GitHub.Exports.Reactive/Services/IPullRequestSessionManager.cs
    

    image

    git diff 8887a8..a39d0b --no-indent-heuristic -- src/GitHub.Exports.Reactive/Services/IPullRequestSessionManager.cs
    

    image

  3. jcansdale commented on Dec 18, 2018

    @jcansdale
    jcansdale
    on Dec 18, 2018
    CollaboratorAuthor
    More actions

    A proof of concept fix for this works! 🎈

    image

    Reacted by Meaghan Osagie (Lewis)
  4. StanleyGoldman
    closed this as completedin #2142on Mar 26, 2019
  5. StanleyGoldman
    changed the title [-]Inline comment appears on PR page but not in GitHub extension[/-] [+]Inline comment appears on GitHub.com page but not in extension[/+] on Apr 11, 2019
  6. StanleyGoldman
    changed the title [-]Inline comment appears on GitHub.com page but not in extension[/-] [+]Inline comment appears on GitHub.com PR page but not in extension[/+] on Apr 11, 2019
  7. StanleyGoldman
    changed the title [-]Inline comment appears on GitHub.com PR page but not in extension[/-] [+]Pull Request inline comment appears on GitHub.com but not in extension[/+] on Apr 11, 2019
  8. github-project-automation
    added this to BUGSon Aug 20, 2024
  9. github-project-automation
    moved this to Done in BUGSon Aug 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    • BUGS
      Status
      Done
      Show more project fields

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402775 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.