git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: "Johannes Schindelin via GitGitGadget" <gitgitgadget@gmail.com>
To: git@vger.kernel.org
Cc: Junio C Hamano <gitster@pobox.com>,
	Johannes Schindelin <johannes.schindelin@gmx.de>
Subject: [PATCH 01/24] Vcproj.pm: auto-generate GUIDs
Date: Thu, 18 Jul 2019 06:19:01 -0700 (PDT)	[thread overview]
Message-ID: <240ff4251774fbede9cce21a5140af655e05d7ba.1563455939.git.gitgitgadget@gmail.com> (raw)
In-Reply-To: <pull.287.git.gitgitgadget@gmail.com>

From: Johannes Schindelin <johannes.schindelin@gmx.de>

We ran out GUIDs. Again. But there is no need to: we can generate them
semi-randomly from the target file name of the project.

Note: the Vcproj generator is probably only interesting for historical
reasons; nevertheless, the upcoming Vcxproj generator (to support modern
Visual Studio versions) is based on the Vcproj generator and it is
better to fix this here first.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
---
 contrib/buildsystems/Generators/Vcproj.pm | 66 ++++-------------------
 1 file changed, 9 insertions(+), 57 deletions(-)

diff --git a/contrib/buildsystems/Generators/Vcproj.pm b/contrib/buildsystems/Generators/Vcproj.pm
index cfa74adcc2..c79b706bc8 100644
--- a/contrib/buildsystems/Generators/Vcproj.pm
+++ b/contrib/buildsystems/Generators/Vcproj.pm
@@ -3,6 +3,7 @@ package Generators::Vcproj;
 
 use strict;
 use vars qw($VERSION);
+use Digest::SHA qw(sha256_hex);
 
 our $VERSION = '1.00';
 our(@ISA, @EXPORT, @EXPORT_OK, @AVAILABLE);
@@ -12,59 +13,12 @@ BEGIN
     push @EXPORT_OK, qw(generate);
 }
 
-my $guid_index = 0;
-my @GUIDS = (
-    "{E07B9989-2BF7-4F21-8918-BE22BA467AC3}",
-    "{278FFB51-0296-4A44-A81A-22B87B7C3592}",
-    "{7346A2C4-F0FD-444F-9EBE-1AF23B2B5650}",
-    "{67F421AC-EB34-4D49-820B-3196807B423F}",
-    "{385DCFE1-CC8C-4211-A451-80FCFC31CA51}",
-    "{97CC46C5-D2CC-4D26-B634-E75792B79916}",
-    "{C7CE21FE-6EF8-4012-A5C7-A22BCEDFBA11}",
-    "{51575134-3FDF-42D1-BABD-3FB12669C6C9}",
-    "{0AE195E4-9823-4B87-8E6F-20C5614AF2FF}",
-    "{4B918255-67CA-43BB-A46C-26704B666E6B}",
-    "{18CCFEEF-C8EE-4CC1-A265-26F95C9F4649}",
-    "{5D5D90FA-01B7-4973-AFE5-CA88C53AC197}",
-    "{1F054320-036D-49E1-B384-FB5DF0BC8AC0}",
-    "{7CED65EE-F2D9-4171-825B-C7D561FE5786}",
-    "{8D341679-0F07-4664-9A56-3BA0DE88B9BC}",
-    "{C189FEDC-2957-4BD7-9FA4-7622241EA145}",
-    "{66844203-1B9F-4C53-9274-164FFF95B847}",
-    "{E4FEA145-DECC-440D-AEEA-598CF381FD43}",
-    "{73300A8E-C8AC-41B0-B555-4F596B681BA7}",
-    "{873FDEB1-D01D-40BF-A1BF-8BBC58EC0F51}",
-    "{7922C8BE-76C5-4AC6-8BF7-885C0F93B782}",
-    "{E245D370-308B-4A49-BFC1-1E527827975F}",
-    "{F6FA957B-66FC-4ED7-B260-E59BBE4FE813}",
-    "{E6055070-0198-431A-BC49-8DB6CEE770AE}",
-    "{54159234-C3EB-43DA-906B-CE5DA5C74654}",
-    "{594CFC35-0B60-46F6-B8EF-9983ACC1187D}",
-    "{D93FCAB7-1F01-48D2-B832-F761B83231A5}",
-    "{DBA5E6AC-E7BE-42D3-8703-4E787141526E}",
-    "{6171953F-DD26-44C7-A3BE-CC45F86FC11F}",
-    "{9E19DDBE-F5E4-4A26-A2FE-0616E04879B8}",
-    "{AE81A615-99E3-4885-9CE0-D9CAA193E867}",
-    "{FBF4067E-1855-4F6C-8BCD-4D62E801A04D}",
-    "{17007948-6593-4AEB-8106-F7884B4F2C19}",
-    "{199D4C8D-8639-4DA6-82EF-08668C35DEE0}",
-    "{E085E50E-C140-4CF3-BE4B-094B14F0DDD6}",
-    "{00785268-A9CC-4E40-AC29-BAC0019159CE}",
-    "{4C06F56A-DCDB-46A6-B67C-02339935CF12}",
-    "{3A62D3FD-519E-4EC9-8171-D2C1BFEA022F}",
-    "{3A62D3FD-519E-4EC9-8171-D2C1BFEA022F}",
-    "{9392EB58-D7BA-410B-B1F0-B2FAA6BC89A7}",
-    "{2ACAB2D5-E0CE-4027-BCA0-D78B2D7A6C66}",
-    "{86E216C3-43CE-481A-BCB2-BE5E62850635}",
-    "{FB631291-7923-4B91-9A57-7B18FDBB7A42}",
-    "{0A176EC9-E934-45B8-B87F-16C7F4C80039}",
-    "{DF55CA80-46E8-4C53-B65B-4990A23DD444}",
-    "{3A0F9895-55D2-4710-BE5E-AD7498B5BF44}",
-    "{294BDC5A-F448-48B6-8110-DD0A81820F8C}",
-    "{4B9F66E9-FAC9-47AB-B1EF-C16756FBFD06}",
-    "{72EA49C6-2806-48BD-B81B-D4905102E19C}",
-    "{5728EB7E-8929-486C-8CD5-3238D060E768}"
-);
+sub generate_guid ($) {
+    my $hex = sha256_hex($_[0]);
+    $hex =~ s/^(.{8})(.{4})(.{4})(.{4})(.{12}).*/{$1-$2-$3-$4-$5}/;
+    $hex =~ tr/a-z/A-Z/;
+    return $hex;
+}
 
 sub generate {
     my ($git_dir, $out_dir, $rel_dir, %build_structure) = @_;
@@ -92,9 +46,8 @@ sub createLibProject {
     $target =~ s/\//_/g;
     $target =~ s/\.a//;
 
-    my $uuid = $GUIDS[$guid_index];
+    my $uuid = generate_guid($libname);
     $$build_structure{"LIBS_${target}_GUID"} = $uuid;
-    $guid_index += 1;
 
     my @srcs = sort(map("$rel_dir\\$_", @{$$build_structure{"LIBS_${libname}_SOURCES"}}));
     my @sources;
@@ -311,9 +264,8 @@ sub createAppProject {
     $target =~ s/\//_/g;
     $target =~ s/\.exe//;
 
-    my $uuid = $GUIDS[$guid_index];
+    my $uuid = generate_guid($appname);
     $$build_structure{"APPS_${target}_GUID"} = $uuid;
-    $guid_index += 1;
 
     my @srcs = sort(map("$rel_dir\\$_", @{$$build_structure{"APPS_${appname}_SOURCES"}}));
     my @sources;
-- 
gitgitgadget


  reply	other threads:[~2019-07-18 13:19 UTC|newest]

Thread overview: 63+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-18 13:19 [PATCH 00/24] Reinstate support for Visual Studio Johannes Schindelin via GitGitGadget
2019-07-18 13:19 ` Johannes Schindelin via GitGitGadget [this message]
2019-07-18 13:19 ` [PATCH 03/24] Vcproj.pm: do not configure VCWebServiceProxyGeneratorTool Johannes Schindelin via GitGitGadget
2019-07-18 13:19 ` [PATCH 02/24] Vcproj.pm: list git.exe first to be startup project Philip Oakley via GitGitGadget
2019-07-18 13:19 ` [PATCH 04/24] Vcproj.pm: urlencode '<' and '>' when generating VC projects Johannes Schindelin via GitGitGadget
2019-07-18 13:19 ` [PATCH 06/24] contrib/buildsystems: ignore irrelevant files in Generators/ Johannes Schindelin via GitGitGadget
2019-07-18 13:19 ` [PATCH 05/24] contrib/buildsystems: ignore invalidcontinue.obj Philip Oakley via GitGitGadget
2019-07-18 13:19 ` [PATCH 07/24] contrib/buildsystems: fix misleading error message Philip Oakley via GitGitGadget
2019-07-18 13:19 ` [PATCH 08/24] contrib/buildsystems: handle quoted spaces in filenames Philip Oakley via GitGitGadget
2019-07-18 13:19 ` [PATCH 09/24] contrib/buildsystems: ignore gettext stuff Philip Oakley via GitGitGadget
2019-07-18 13:19 ` [PATCH 10/24] contrib/buildsystems: redirect errors of the dry run into a log file Philip Oakley via GitGitGadget
2019-07-18 13:19 ` [PATCH 12/24] contrib/buildsystems: error out on unknown option Johannes Schindelin via GitGitGadget
2019-07-18 13:19 ` [PATCH 11/24] contrib/buildsystems: optionally capture the dry-run in a file Philip Oakley via GitGitGadget
2019-07-18 13:19 ` [PATCH 13/24] contrib/buildsystems: handle the curl library option Philip Oakley via GitGitGadget
2019-07-18 13:19 ` [PATCH 15/24] contrib/buildsystems: also handle -lexpat Johannes Schindelin via GitGitGadget
2019-07-18 13:19 ` [PATCH 14/24] contrib/buildsystems: handle libiconv, too Johannes Schindelin via GitGitGadget
2019-07-18 13:19 ` [PATCH 16/24] contrib/buildsystems: handle options starting with a slash Johannes Schindelin via GitGitGadget
2019-07-18 13:19 ` [PATCH 17/24] contrib/buildsystems: add a backend for modern Visual Studio versions Johannes Schindelin via GitGitGadget
2019-07-18 13:19 ` [PATCH 18/24] msvc: add a Makefile target to pre-generate the Visual Studio solution Johannes Schindelin via GitGitGadget
2019-07-18 13:19 ` [PATCH 19/24] vcxproj: also link-or-copy builtins Johannes Schindelin via GitGitGadget
2019-07-18 13:19 ` [PATCH 20/24] .gitignore: touch up the entries regarding Visual Studio Philip Oakley via GitGitGadget
2019-07-18 13:19 ` [PATCH 21/24] .gitignore: ignore Visual Studio's temporary/generated files Johannes Schindelin via GitGitGadget
2019-07-18 13:19 ` [PATCH 22/24] bin-wrappers: append `.exe` to target paths if necessary Johannes Schindelin via GitGitGadget
2019-07-18 13:19 ` [PATCH 23/24] t5505,t5516: create .git/branches/ when needed Johannes Schindelin via GitGitGadget
2019-07-18 20:34   ` Junio C Hamano
2019-07-19 14:52     ` Johannes Schindelin
2019-07-19 15:07       ` Junio C Hamano
2019-07-19 15:36       ` Junio C Hamano
2019-07-19 16:30         ` Junio C Hamano
2019-07-18 13:19 ` [PATCH 24/24] git: avoid calling aliased builtins via their dashed form Johannes Schindelin via GitGitGadget
2019-07-29 20:08 ` [PATCH v2 00/23] Reinstate support for Visual Studio Johannes Schindelin via GitGitGadget
2019-07-29 20:08   ` [PATCH v2 02/23] Vcproj.pm: list git.exe first to be startup project Philip Oakley via GitGitGadget
2019-07-29 20:08   ` [PATCH v2 01/23] Vcproj.pm: auto-generate GUIDs Johannes Schindelin via GitGitGadget
2019-07-29 20:08   ` [PATCH v2 03/23] Vcproj.pm: do not configure VCWebServiceProxyGeneratorTool Johannes Schindelin via GitGitGadget
2019-07-29 20:08   ` [PATCH v2 04/23] Vcproj.pm: urlencode '<' and '>' when generating VC projects Johannes Schindelin via GitGitGadget
2019-07-29 20:08   ` [PATCH v2 05/23] contrib/buildsystems: ignore invalidcontinue.obj Philip Oakley via GitGitGadget
2019-07-29 20:08   ` [PATCH v2 06/23] contrib/buildsystems: ignore irrelevant files in Generators/ Johannes Schindelin via GitGitGadget
2019-07-29 20:08   ` [PATCH v2 08/23] contrib/buildsystems: handle quoted spaces in filenames Philip Oakley via GitGitGadget
2019-07-29 20:08   ` [PATCH v2 07/23] contrib/buildsystems: fix misleading error message Philip Oakley via GitGitGadget
2019-07-29 20:08   ` [PATCH v2 09/23] contrib/buildsystems: ignore gettext stuff Philip Oakley via GitGitGadget
2019-07-29 20:08   ` [PATCH v2 10/23] contrib/buildsystems: redirect errors of the dry run into a log file Philip Oakley via GitGitGadget
2019-07-29 20:08   ` [PATCH v2 11/23] contrib/buildsystems: optionally capture the dry-run in a file Philip Oakley via GitGitGadget
2019-07-29 20:08   ` [PATCH v2 12/23] contrib/buildsystems: error out on unknown option Johannes Schindelin via GitGitGadget
2019-07-29 20:08   ` [PATCH v2 13/23] contrib/buildsystems: handle the curl library option Philip Oakley via GitGitGadget
2019-07-29 20:08   ` [PATCH v2 14/23] contrib/buildsystems: handle libiconv, too Johannes Schindelin via GitGitGadget
2019-07-29 20:08   ` [PATCH v2 15/23] contrib/buildsystems: also handle -lexpat Johannes Schindelin via GitGitGadget
2019-07-29 20:08   ` [PATCH v2 16/23] contrib/buildsystems: handle options starting with a slash Johannes Schindelin via GitGitGadget
2019-07-29 20:08   ` [PATCH v2 18/23] msvc: add a Makefile target to pre-generate the Visual Studio solution Johannes Schindelin via GitGitGadget
2019-07-29 20:08   ` [PATCH v2 17/23] contrib/buildsystems: add a backend for modern Visual Studio versions Johannes Schindelin via GitGitGadget
2019-07-29 20:08   ` [PATCH v2 19/23] vcxproj: also link-or-copy builtins Johannes Schindelin via GitGitGadget
2019-07-29 20:08   ` [PATCH v2 20/23] .gitignore: touch up the entries regarding Visual Studio Philip Oakley via GitGitGadget
2019-08-25 12:07     ` SZEDER Gábor
2019-08-25 13:20       ` Philip Oakley
2019-08-25 19:09         ` SZEDER Gábor
2019-08-25 22:21           ` Philip Oakley
2019-08-26  9:10             ` SZEDER Gábor
2019-08-28 11:34               ` Johannes Schindelin
2019-08-26 14:57             ` Johannes Schindelin
2019-08-26 15:49               ` Junio C Hamano
2019-07-29 20:08   ` [PATCH v2 21/23] .gitignore: ignore Visual Studio's temporary/generated files Johannes Schindelin via GitGitGadget
2019-07-29 20:08   ` [PATCH v2 23/23] git: avoid calling aliased builtins via their dashed form Johannes Schindelin via GitGitGadget
2019-07-29 20:08   ` [PATCH v2 22/23] bin-wrappers: append `.exe` to target paths if necessary Johannes Schindelin via GitGitGadget
2019-07-29 21:56   ` [PATCH v2 00/23] Reinstate support for Visual Studio Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=240ff4251774fbede9cce21a5140af655e05d7ba.1563455939.git.gitgitgadget@gmail.com \
    --to=gitgitgadget@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=johannes.schindelin@gmx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).