Last active
August 1, 2023 02:51
-
-
Save adriancampos/36945d04b21a2068f2facc54344b4f9c to your computer and use it in GitHub Desktop.
Revisions
-
adriancampos renamed this gist
Feb 22, 2019 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
adriancampos renamed this gist
Feb 22, 2019 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
adriancampos renamed this gist
Feb 22, 2019 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
adriancampos revised this gist
Feb 22, 2019 . 1 changed file with 9 additions and 11 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,31 +1,29 @@ param([String]$firstcommit="HEAD", [String]$secondcommit="$firstcommit^") $singlecommit = $secondcommit -eq "${firstcommit}^" # get commit hash from name. Used for naming the zip. $firstcommit = $(git rev-parse --short --verify $firstcommit) $secondcommit = $(git rev-parse --short --verify $secondcommit) $outpath = "${firstcommit}" if (!$singlecommit) { $outpath += "_${secondcommit}" } echo "Diff ${firstcommit}...${secondcommit}" echo "Changed files:" echo $(git diff --name-only $firstcommit $secondcommit) echo $(git diff --name-only $firstcommit $secondcommit) >> "${outpath}.txt" # create flattened archive Compress-Archive -Force -DestinationPath "${outpath}_flat.zip" -Path $(git diff --name-only $firstcommit $secondcommit) # create structured archive git archive -o "${outpath}.zip" $firstcommit $(git diff --name-only $firstcommit $secondcommit) echo "Created $outpath" -
adriancampos revised this gist
Feb 22, 2019 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,4 @@ # Usage: `.\createarchive.ps1` -
adriancampos revised this gist
Feb 22, 2019 . 1 changed file with 4 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,10 +1,13 @@ #Usage: `.\createarchive.ps1` Creates an archive of the files that changed between HEAD and HEAD^ `.\createarchive.ps1 e39eef` Creates an archive of the files that changed between e39eef and e39eef^ `.\createarchive.ps1 e39eef 1e4bf3` Creates an archive of the files that changed between e39eef and 1e4bf3^ -
adriancampos revised this gist
Feb 22, 2019 . 1 changed file with 1 addition and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,5 @@ Usage: `.\createarchive.ps1` Creates an archive of the files that changed between HEAD and HEAD^ -
adriancampos created this gist
Feb 22, 2019 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,9 @@ Usage: `.\createarchive.ps1` Creates an archive of the files that changed between HEAD and HEAD^ `.\createarchive.ps1 e39eef` Creates an archive of the files that changed between e39eef and e39eef^ `.\createarchive.ps1 e39eef 1e4bf3` Creates an archive of the files that changed between e39eef and 1e4bf3^ This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,31 @@ param([String]$commit="HEAD", [String]$secondcommit="$commit^") echo $commit echo $secondcommit $singlecommit = $secondcommit -eq "${commit}^" # get commit hash from name. Used for naming the zip. $commit = $(git rev-parse --short --verify $commit) $secondcommit = $(git rev-parse --short --verify $secondcommit) $outpath = "${commit}" if (!$singlecommit) { $outpath += "_${secondcommit}" } echo "Diff ${commit}...${secondcommit}" echo "Changed files:" echo $(git diff --name-only $commit $secondcommit) # create flattened archive Compress-Archive -Force -DestinationPath "${outpath}_flat.zip" -Path $(git diff --name-only $commit $secondcommit) # create structured archive git archive -o "${outpath}.zip" $commit $(git diff --name-only $commit $secondcommit) echo "Created $outpath"