Uploaded image for project: 'SonarQube SCM Git'
  1. SonarQube SCM Git
  2. SONARSCGIT-13

Detect shallow clone and log a warning

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.3
    • Labels:
      None

      Description

      The blame information can be completely wrong when fetching it from a shallow clone, without errors or warnings. When the outcome is invalid data, it's extremely difficult to diagnose that it comes from a shallow clone.

      If a line in a file was not changed in the commits that were downloaded as part of the shallow fetch, git will report the first known commit as the author.

      This has a big impact on the auto-assignment of new issues.

      We should try to detect if the current repo is a shallow clone. If it's the case:

      • give a warning (one time)
      • return no blame (no-op)

      One way is to detect shallow clones is to read .git/shallow.

        Attachments

          Activity

            People

            Assignee:
            janos.gyerik Janos Gyerik (Inactive)
            Reporter:
            julien.henry Julien Henry
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Due:
              Created:
              Updated:
              Resolved: