Skip to content

Commit 3576678

Browse files
jonathanpeppersjonpryor
authored andcommitted
[build] use relative paths for <GitBlame/> (#2594)
Downstream in monodroid, I'm getting a build failure such as: /usr/bin/git blame "/full/path/to/external/xamarin-android/Configuration.props" XAVersionInfo.targets(53,5): error MSB6006: "git" exited with code 128. XAVersionInfo.targets(61,5): error MSB4044: The "GitCommitsInRange" task was not given a value for the required parameter "StartCommit". If I run the git command manually: fatal: not a git repository (or any of the parent directories): .git Turns Out™ that some `git` versions are seemingly not happy when given a full path name, i.e. this sequence of command can fail: $ cd /full/path/to/xamarin-android $ git blame `pwd`/Configuration.props Appease these `git` versions and update the `<GitBlame>` invocation to use a relative path, effectively doing: $ cd /full/path/to/xamarin-android $ git blame Configuration.props
1 parent 812d350 commit 3576678

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

build-tools/scripts/XAVersionInfo.targets

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
<Target Name="GetXAVersionInfo"
5252
DependsOnTargets="_GetSubmodulesVersionInfo">
5353
<GitBlame
54-
FileName="$(XamarinAndroidSourcePath)\Configuration.props"
54+
FileName="Configuration.props"
5555
LineFilter="&lt;ProductVersion&gt;"
5656
WorkingDirectory="$(XamarinAndroidSourcePath)"
5757
ToolPath="$(GitToolPath)"

build-tools/xa-prep-tasks/Xamarin.Android.BuildTools.PrepTasks/GitBlame.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public override bool Execute ()
4545

4646
protected override string GenerateCommandLineCommands ()
4747
{
48-
return $"blame \"{Path.GetFullPath (FileName.ItemSpec)}\"";
48+
return $"blame \"{FileName.ItemSpec}\"";
4949
}
5050

5151
protected override void LogEventsFromTextOutput (string singleLine, MessageImportance messageImportance)

0 commit comments

Comments
 (0)