-
Notifications
You must be signed in to change notification settings - Fork 12
Open
Description
This is for other people's future reference. I was using the MSBuildGitHash Nuget package v2.0.2.
While trying to run some custom git commands to capture additional information, I ran into problems with character sequences that needed to be escaped.
%needs to be escaped as%%aeneeds to be escaped asa%ecdneeds to be escaped asc%d
These are the git commands I was trying to run:
git show --quiet --format=%aegit show --quiet --format=%angit show --quiet --format=%cd --date=iso-strictgit show --quiet --format=%Bgit show --quiet --format=%H
This is the corresponding ItemGroup with correctly escaped character sequences:
<ItemGroup>
<AssemblyMetadataCommand Include="GitAuthorEmail">
<Command>git show --quiet --format=%%a%e</Command>
</AssemblyMetadataCommand>
<AssemblyMetadataCommand Include="GitAuthorName">
<Command>git show --quiet --format=%%an</Command>
</AssemblyMetadataCommand>
<AssemblyMetadataCommand Include="GitCommitDate">
<Command>git show --quiet --format=%%c%d --date=iso-strict</Command>
</AssemblyMetadataCommand>
<AssemblyMetadataCommand Include="GitCommitMessage">
<Command>git show --quiet --format=%%B</Command>
</AssemblyMetadataCommand>
<AssemblyMetadataCommand Include="GitFullHash">
<Command>git show --quiet --format=%%H</Command>
</AssemblyMetadataCommand>
</ItemGroup>
There may be other character sequences that require escaping which I am not yet aware of.
ErcNovelT and sidecut
Metadata
Metadata
Assignees
Labels
No labels