{"thread":{"id":"28829","subject":"Re: [PATCH] Add options to specify snapshot file name, prefix","startedAt":"2011-11-03T06:28:49Z","lastAt":"2011-11-03T06:28:49Z","messageCount":1,"participants":["Thomas Guyot-Sionnest"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"178759","messageId":"4EB234A1.7090300@aei.ca","threadId":"28829","inReplyTo":"1320298641-11149-1-git-send-email-dermoth@aei.ca","subject":"Re: [PATCH] Add options to specify snapshot file name, prefix","fromName":"Thomas Guyot-Sionnest","fromEmail":"dermoth@aei.ca","sentAt":"2011-11-03T06:28:49Z","receivedAt":"2011-11-03T06:28:49Z","isPatch":true,"sender":{"key":"dermoth@aei.ca","avatar":null},"body":"-----BEGIN PGP SIGNED MESSAGE-----\nHash: SHA1\n\nPlease disregard; i've actually managed to break the patch while playing\nwith it.\n\nI will resubmit.\n\n- --\n\nThomas\n\nOn 11-11-03 01:37 AM, Thomas Guyot-Sionnest wrote:\n> commit b629275 implemented \"smart\" snapshot names and prefixes. I have\n> scripts that used to rely on the old behaviour which allowed in some\n> cases to have fixed prefix, and would require modifications to work with\n> newer Gitweb.\n> \n> This patch adds two parameters for overriding the snapshot name and\n> prefix, sn and sp respectively. For example, to get a snapshot\n> named \"myproject.[suffix]\" with no prefix one can add this query string:\n>   ?sn=myproject;sp=\n> \n> Signed-off-by: Thomas Guyot-Sionnest <dermoth@aei.ca>\n> ---\n>  gitweb/gitweb.perl |    8 ++++++++\n>  1 files changed, 8 insertions(+), 0 deletions(-)\n> \n> diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl\n> index 4f0c3bd..4820ef7 100755\n> --- a/gitweb/gitweb.perl\n> +++ b/gitweb/gitweb.perl\n> @@ -756,6 +756,8 @@ our @cgi_param_mapping = (\n>  \tsearchtext => \"s\",\n>  \tsearchtype => \"st\",\n>  \tsnapshot_format => \"sf\",\n> +\tsnapshot_name => \"sn\",\n> +\tsnapshot_prefix => \"sp\",\n>  \textra_options => \"opt\",\n>  \tsearch_use_regexp => \"sr\",\n>  \tctag => \"by_tag\",\n> @@ -6684,6 +6686,12 @@ sub git_snapshot {\n>  \t}\n>  \n>  \tmy ($name, $prefix) = snapshot_name($project, $hash);\n> +\tif (defined($input_params{'snapshot_name'})) {\n> +\t\t$name = $input_params{'snapshot_name'};\n> +\t}\n> +\tif (defined($input_params{'snapshot_prefix'})) {\n> +\t\t$prefix = $input_params{'snapshot_prefix'};\n> +\t}\n>  \tmy $filename = \"$name$known_snapshot_formats{$format}{'suffix'}\";\n>  \tmy $cmd = quote_command(\n>  \t\tgit_cmd(), 'archive',\n\n\n- -- \nThomas\n-----BEGIN PGP SIGNATURE-----\nVersion: GnuPG v1.4.10 (GNU/Linux)\nComment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/\n\niEYEARECAAYFAk6yNJcACgkQ6dZ+Kt5BchZkCgCgvJ9kAF636HYCAwQ7LoWu8ckG\n8+8Anj5ocii3c7vKQ2/eVjcAvDJxsvhQ\n=jGwr\n-----END PGP SIGNATURE-----\n"}]}