{"thread":{"id":"9030","subject":"[PATCH] git-svn init/clone --stdlayout option to default-init trunk/tags/branches","startedAt":"2007-07-14T09:25:28Z","lastAt":"2007-08-23T06:10:09Z","messageCount":7,"participants":["martin f. krafft","Eric Wong","martin f krafft"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"47334","messageId":"1184405128718-git-send-email-madduck@madduck.net","threadId":"9030","inReplyTo":null,"subject":"[PATCH] git-svn init/clone --stdlayout option to default-init trunk/tags/branches","fromName":"martin f. krafft","fromEmail":"madduck@madduck.net","sentAt":"2007-07-14T09:25:28Z","receivedAt":"2007-07-14T09:25:28Z","isPatch":true,"sender":{"key":"madduck@madduck.net","avatar":null},"body":"The --stdlayout option to git-svn init/clone initialises the default\nSubversion values of trunk,tags,branches: -T trunk -b branches -t tags.\nIf any of the -T/-t/-b options are given in addition, they are given\npreference.\n\nSigned-off-by: martin f. krafft <madduck@madduck.net>\n---\n Documentation/git-svn.txt |    6 +++++-\n git-svn.perl              |   11 +++++++++--\n 2 files changed, 14 insertions(+), 3 deletions(-)\n\ndiff --git a/Documentation/git-svn.txt b/Documentation/git-svn.txt\nindex 0a210e4..9e74b27 100644\n--- a/Documentation/git-svn.txt\n+++ b/Documentation/git-svn.txt\n@@ -44,10 +44,14 @@ COMMANDS\n --tags=<tags_subdir>;;\n -b<branches_subdir>;;\n --branches=<branches_subdir>;;\n+--stdlayout;;\n \tThese are optional command-line options for init.  Each of\n \tthese flags can point to a relative repository path\n \t(--tags=project/tags') or a full url\n-\t(--tags=https://foo.org/project/tags)\n+\t(--tags=https://foo.org/project/tags). The option --stdlayout is\n+\ta shorthand way of setting trunk,tags,branches as the relative paths,\n+\twhich is the Subversion default. If any of the other options are given\n+\tas well, they take precedence.\n --no-metadata;;\n \tSet the 'noMetadata' option in the [svn-remote] config.\n --use-svm-props;;\ndiff --git a/git-svn.perl b/git-svn.perl\nindex b3dffcc..affba8e 100755\n--- a/git-svn.perl\n+++ b/git-svn.perl\n@@ -77,11 +77,12 @@ my %fc_opts = ( 'follow-parent|follow!' => \\$Git::SVN::_follow_parent,\n \t\t   \\$Git::SVN::_repack_flags,\n \t\t%remote_opts );\n \n-my ($_trunk, $_tags, $_branches);\n+my ($_trunk, $_tags, $_branches, $_stdlayout);\n my %icv;\n my %init_opts = ( 'template=s' => \\$_template, 'shared:s' => \\$_shared,\n                   'trunk|T=s' => \\$_trunk, 'tags|t=s' => \\$_tags,\n                   'branches|b=s' => \\$_branches, 'prefix=s' => \\$_prefix,\n+                  'stdlayout' => \\$_stdlayout,\n                   'minimize-url|m' => \\$Git::SVN::_minimize_url,\n \t\t  'no-metadata' => sub { $icv{noMetadata} = 1 },\n \t\t  'use-svm-props' => sub { $icv{useSvmProps} = 1 },\n@@ -292,7 +293,8 @@ sub init_subdir {\n sub cmd_clone {\n \tmy ($url, $path) = @_;\n \tif (!defined $path &&\n-\t    (defined $_trunk || defined $_branches || defined $_tags) &&\n+\t    (defined $_trunk || defined $_branches || defined $_tags ||\n+\t\tdefined $_stdlayout) &&\n \t    $url !~ m#^[a-z\\+]+://#) {\n \t\t$path = $url;\n \t}\n@@ -302,6 +304,11 @@ sub cmd_clone {\n }\n \n sub cmd_init {\n+        if (defined $_stdlayout) {\n+          $_trunk = 'trunk' if (!defined $_trunk);\n+          $_tags = 'tags' if (!defined $_tags);\n+          $_branches = 'branches' if (!defined $_branches);\n+        }\n \tif (defined $_trunk || defined $_branches || defined $_tags) {\n \t\treturn cmd_multi_init(@_);\n \t}\n-- \n1.5.3.rc1.9.gf029\n"},{"id":"47341","messageId":"20070714105010.GA14842@muzzle","threadId":"9030","inReplyTo":"1184405128718-git-send-email-madduck@madduck.net","subject":"Re: [PATCH] git-svn init/clone --stdlayout option to default-init trunk/tags/branches","fromName":"Eric Wong","fromEmail":"normalperson@yhbt.net","sentAt":"2007-07-14T10:50:10Z","receivedAt":"2007-07-14T10:50:10Z","isPatch":true,"sender":{"key":"e@80x24.org","avatar":null},"body":"\"martin f. krafft\" <madduck@madduck.net> wrote:\n> The --stdlayout option to git-svn init/clone initialises the default\n> Subversion values of trunk,tags,branches: -T trunk -b branches -t tags.\n> If any of the -T/-t/-b options are given in addition, they are given\n> preference.\n> \n> Signed-off-by: martin f. krafft <madduck@madduck.net>\n\nThanks.  I've been meaning to do this myself, but keep on putting it\noff...\n\nThis looks good and useful, but can I also have a  shorthand \"-s\" for\nthis, too?  I'm lazy, thanks :)\n\nAlso, nitpicking, there's been some whitespace damage:\n\nI use tab characters for indentation, and (should be using) spaces for\nalignment.\n\n> ---\n>  Documentation/git-svn.txt |    6 +++++-\n>  git-svn.perl              |   11 +++++++++--\n>  2 files changed, 14 insertions(+), 3 deletions(-)\n> \n> diff --git a/Documentation/git-svn.txt b/Documentation/git-svn.txt\n> index 0a210e4..9e74b27 100644\n> --- a/Documentation/git-svn.txt\n> +++ b/Documentation/git-svn.txt\n> @@ -44,10 +44,14 @@ COMMANDS\n>  --tags=<tags_subdir>;;\n>  -b<branches_subdir>;;\n>  --branches=<branches_subdir>;;\n> +--stdlayout;;\n>  \tThese are optional command-line options for init.  Each of\n>  \tthese flags can point to a relative repository path\n>  \t(--tags=project/tags') or a full url\n> -\t(--tags=https://foo.org/project/tags)\n> +\t(--tags=https://foo.org/project/tags). The option --stdlayout is\n> +\ta shorthand way of setting trunk,tags,branches as the relative paths,\n> +\twhich is the Subversion default. If any of the other options are given\n> +\tas well, they take precedence.\n>  --no-metadata;;\n>  \tSet the 'noMetadata' option in the [svn-remote] config.\n>  --use-svm-props;;\n> diff --git a/git-svn.perl b/git-svn.perl\n> index b3dffcc..affba8e 100755\n> --- a/git-svn.perl\n> +++ b/git-svn.perl\n> @@ -77,11 +77,12 @@ my %fc_opts = ( 'follow-parent|follow!' => \\$Git::SVN::_follow_parent,\n>  \t\t   \\$Git::SVN::_repack_flags,\n>  \t\t%remote_opts );\n>  \n> -my ($_trunk, $_tags, $_branches);\n> +my ($_trunk, $_tags, $_branches, $_stdlayout);\n>  my %icv;\n>  my %init_opts = ( 'template=s' => \\$_template, 'shared:s' => \\$_shared,\n>                    'trunk|T=s' => \\$_trunk, 'tags|t=s' => \\$_tags,\n>                    'branches|b=s' => \\$_branches, 'prefix=s' => \\$_prefix,\n> +                  'stdlayout' => \\$_stdlayout,\n>                    'minimize-url|m' => \\$Git::SVN::_minimize_url,\n>  \t\t  'no-metadata' => sub { $icv{noMetadata} = 1 },\n>  \t\t  'use-svm-props' => sub { $icv{useSvmProps} = 1 },\n\nYes, I'm not consistent myself with using spaces for alignment :(\nThanks for using spaces here.\n\n> @@ -292,7 +293,8 @@ sub init_subdir {\n>  sub cmd_clone {\n>  \tmy ($url, $path) = @_;\n>  \tif (!defined $path &&\n> -\t    (defined $_trunk || defined $_branches || defined $_tags) &&\n> +\t    (defined $_trunk || defined $_branches || defined $_tags ||\n> +\t\tdefined $_stdlayout) &&\n\nThe lines above and below use spaces for alignment, so this one should,\ndefinitely be using spaces after the initial tab too.\n\n>  \t    $url !~ m#^[a-z\\+]+://#) {\n>  \t\t$path = $url;\n>  \t}\n> @@ -302,6 +304,11 @@ sub cmd_clone {\n>  }\n>  \n>  sub cmd_init {\n> +        if (defined $_stdlayout) {\n> +          $_trunk = 'trunk' if (!defined $_trunk);\n> +          $_tags = 'tags' if (!defined $_tags);\n> +          $_branches = 'branches' if (!defined $_branches);\n> +        }\n\nIndentation is always done in tabs in git-svn.  I *should* be using\nspaces for alignment but I myself have been sloppy :x\n\n>  \tif (defined $_trunk || defined $_branches || defined $_tags) {\n>  \t\treturn cmd_multi_init(@_);\n>  \t}\n\n-- \nEric Wong\n"},{"id":"47343","messageId":"20070714110431.GA3854@piper.oerlikon.madduck.net","threadId":"9030","inReplyTo":"20070714105010.GA14842@muzzle","subject":"Re: [PATCH] git-svn init/clone --stdlayout option to default-init trunk/tags/branches","fromName":"martin f krafft","fromEmail":"madduck@madduck.net","sentAt":"2007-07-14T11:04:31Z","receivedAt":"2007-07-14T11:04:31Z","isPatch":true,"sender":{"key":"madduck@madduck.net","avatar":null},"body":"also sprach Eric Wong <normalperson@yhbt.net> [2007.07.14.1250 +0200]:\n> This looks good and useful, but can I also have a  shorthand \"-s\" for\n> this, too?  I'm lazy, thanks :)\n\nOf course.\n\n> Also, nitpicking, there's been some whitespace damage:\n> \n> I use tab characters for indentation, and (should be using) spaces for\n> alignment.\n\nWhat's the difference? Or is it simply:\n\n  no. of tabs:   int(column / 8)\n  no. of spaces: column % 8\n\n?\n\nI am sorry, I tried to do it right, even paid attention to the\ntabs/spaces thing, but I guess I failed.\n\n-- \nmartin;              (greetings from the heart of the sun.)\n  \\____ echo mailto: !#^.\"<*>\"|tr \"<*> mailto:\" net@madduck\n \nspamtraps: madduck.bogus@madduck.net\n \nsave the plankton - eat a whale.\n"},{"id":"47344","messageId":"20070714113435.GC14842@muzzle","threadId":"9030","inReplyTo":"20070714110431.GA3854@piper.oerlikon.madduck.net","subject":"Re: [PATCH] git-svn init/clone --stdlayout option to default-init trunk/tags/branches","fromName":"Eric Wong","fromEmail":"normalperson@yhbt.net","sentAt":"2007-07-14T11:34:35Z","receivedAt":"2007-07-14T11:34:35Z","isPatch":true,"sender":{"key":"e@80x24.org","avatar":null},"body":"martin f krafft <madduck@madduck.net> wrote:\n> also sprach Eric Wong <normalperson@yhbt.net> [2007.07.14.1250 +0200]:\n> > This looks good and useful, but can I also have a  shorthand \"-s\" for\n> > this, too?  I'm lazy, thanks :)\n> \n> Of course.\n> \n> > Also, nitpicking, there's been some whitespace damage:\n> > \n> > I use tab characters for indentation, and (should be using) spaces for\n> > alignment.\n> \n> What's the difference? Or is it simply:\n> \n>   no. of tabs:   int(column / 8)\n>   no. of spaces: column % 8\n\nIt's also easier/faster to navigate code with tabs since there are fewer\ncharacters to iterate over, less granular points for indentation, making\nit easier to to get to a desired indentation level.\n\nThe less granularity with tabs means I can avoid situations where where\nI wonder if I'm correctly aligned with other pieces of code.  I even\nhave auto-indent set, but occasionally with spaces (when I work on Ruby\ncode) I still have problems with being off-by-one after editing\nsomething.\n\nThere's absolutely no way I can misalign a block of code when alignment\ngranularity is 8 characters no matter how sleepy I get :)\n\nI use tabs for indentation where they denote logically different code\npaths / nesting.\n\nSpaces (for alignment, not indentation) are mainly aesthetic.  I use\nthem in spaces when I need finer control (usually long conditionals in\nif-statements that are wrapped).\n\nTabs can also be easily reconfigured in editors to change the amount of\nscreen real estate they consume.  Not really useful in git-svn since\nI keep it <80 columns anyways.\n\n> I am sorry, I tried to do it right, even paid attention to the\n> tabs/spaces thing, but I guess I failed.\n\nNo worries.  The maintainers here are also very picky about trailing\nwhitespace and spaces that appear before tab characters, too and I\nbecame much more disciplined about that myself the past year.\n\nI have highlighting search set in my editor (vim :set hls)\nand usually just search for spaces vs tabs to make sure I'm clean.\n\nOf course, maintaining a consistent whitespace style helps a *lot* with\nthe git/Linux patch exchange development style because it avoids\nneedless patch application conflicts that arise from whitespace\ndifferences.\n\n-- \nEric Wong\n"},{"id":"47345","messageId":"20070714120450.GA21890@piper.oerlikon.madduck.net","threadId":"9030","inReplyTo":"20070714113435.GC14842@muzzle","subject":"Re: [PATCH] git-svn init/clone --stdlayout option to default-init trunk/tags/branches","fromName":"martin f krafft","fromEmail":"madduck@madduck.net","sentAt":"2007-07-14T12:04:50Z","receivedAt":"2007-07-14T12:04:50Z","isPatch":true,"sender":{"key":"madduck@madduck.net","avatar":null},"body":"also sprach Eric Wong <normalperson@yhbt.net> [2007.07.14.1334 +0200]:\n> I have highlighting search set in my editor (vim :set hls)\n> and usually just search for spaces vs tabs to make sure I'm clean.\n\nTry:\n\n  :se lcs=tab:>-,trail,-\n\n  augroup listinsert\n    autocmd InsertEnter * set nolist\n    autocmd InsertLeave * set list\n  augroup end\n\n> Of course, maintaining a consistent whitespace style helps a *lot*\n> with the git/Linux patch exchange development style because it\n> avoids needless patch application conflicts that arise from\n> whitespace differences.\n\nUsing tabs also makes it impossible to X-cut-paste patches from\nemails; you *have* to use git-am and/or a temporary file, which\ni don't like at all.\n\nBut thanks for the explanation.\n\n-- \nmartin;              (greetings from the heart of the sun.)\n  \\____ echo mailto: !#^.\"<*>\"|tr \"<*> mailto:\" net@madduck\n \nspamtraps: madduck.bogus@madduck.net\n \nMost Intelligent Customers Realise Our Software Only Fools Them.\n"},{"id":"47379","messageId":"20070714203805.GA5419@soma","threadId":"9030","inReplyTo":"20070714120450.GA21890@piper.oerlikon.madduck.net","subject":"Re: [PATCH] git-svn init/clone --stdlayout option to default-init trunk/tags/branches","fromName":"Eric Wong","fromEmail":"normalperson@yhbt.net","sentAt":"2007-07-14T20:38:05Z","receivedAt":"2007-07-14T20:38:05Z","isPatch":true,"sender":{"key":"e@80x24.org","avatar":null},"body":"martin f krafft <madduck@madduck.net> wrote:\n> also sprach Eric Wong <normalperson@yhbt.net> [2007.07.14.1334 +0200]:\n> > I have highlighting search set in my editor (vim :set hls)\n> > and usually just search for spaces vs tabs to make sure I'm clean.\n> \n> Try:\n> \n>   :se lcs=tab:>-,trail,-\n\nThat didn't work, this does:\n\n    :se lcs=tab:>-,trail:-\n\n>   augroup listinsert\n>     autocmd InsertEnter * set nolist\n>     autocmd InsertLeave * set list\n>   augroup end\n\nEep.  Too confusing ;)  I have my hls color set to be a red underscore\n(which nothing else in my syntax higlighting uses), so it's less\nintrusive for me.\n\n> > Of course, maintaining a consistent whitespace style helps a *lot*\n> > with the git/Linux patch exchange development style because it\n> > avoids needless patch application conflicts that arise from\n> > whitespace differences.\n> \n> Using tabs also makes it impossible to X-cut-paste patches from\n> emails; you *have* to use git-am and/or a temporary file, which\n> i don't like at all.\n\nAh.  I that's one of the reasons I rarely use X-cut-paste for multi-line\nstrings.\n\nWhen I apply patches with or without git-am from email, I just start\nmutt inside the working source directory I'm in, and from the mutt index\nI spawn vim to edit any email (just hit 'e'), go into visual mode,\nselect the part I want to apply and pipe that to whatever patch\napplication program I want to use, and :q! out of vim.\n\n-- \nEric Wong\n"},{"id":"51329","messageId":"20070823061009.GA10547@soma","threadId":"9030","inReplyTo":"1184405128718-git-send-email-madduck@madduck.net","subject":"Re: [PATCH] git-svn init/clone --stdlayout option to default-init trunk/tags/branches","fromName":"Eric Wong","fromEmail":"normalperson@yhbt.net","sentAt":"2007-08-23T06:10:09Z","receivedAt":"2007-08-23T06:10:09Z","isPatch":true,"sender":{"key":"e@80x24.org","avatar":null},"body":"Here's a cleaned up version of this patch with my tweaks.\n\n>From f5b6da6bc4e2d879ca200993f0d3806486e8fb21 Mon Sep 17 00:00:00 2001\nFrom: martin f. krafft <madduck@madduck.net>\nDate: Sat, 14 Jul 2007 11:25:28 +0200\nSubject: [PATCH] git-svn init/clone --stdlayout option to default-init trunk/tags/branches\n\nThe --stdlayout option to git-svn init/clone initialises the default\nSubversion values of trunk,tags,branches: -T trunk -b branches -t tags.\nIf any of the -T/-t/-b options are given in addition, they are given\npreference.\n\n[ew: fixed whitespace and added \"-s\" shortcut]\n\nSigned-off-by: martin f. krafft <madduck@madduck.net>\nSigned-off-by: Eric Wong <normalperson@yhbt.net>\n---\n Documentation/git-svn.txt |    7 ++++++-\n git-svn.perl              |   11 +++++++++--\n 2 files changed, 15 insertions(+), 3 deletions(-)\n\ndiff --git a/Documentation/git-svn.txt b/Documentation/git-svn.txt\nindex fbc5887..3e2a63b 100644\n--- a/Documentation/git-svn.txt\n+++ b/Documentation/git-svn.txt\n@@ -44,10 +44,15 @@ COMMANDS\n --tags=<tags_subdir>;;\n -b<branches_subdir>;;\n --branches=<branches_subdir>;;\n+-s;;\n+--stdlayout;;\n \tThese are optional command-line options for init.  Each of\n \tthese flags can point to a relative repository path\n \t(--tags=project/tags') or a full url\n-\t(--tags=https://foo.org/project/tags)\n+\t(--tags=https://foo.org/project/tags). The option --stdlayout is\n+\ta shorthand way of setting trunk,tags,branches as the relative paths,\n+\twhich is the Subversion default. If any of the other options are given\n+\tas well, they take precedence.\n --no-metadata;;\n \tSet the 'noMetadata' option in the [svn-remote] config.\n --use-svm-props;;\ndiff --git a/git-svn.perl b/git-svn.perl\nindex 7a8ffd5..4e325b7 100755\n--- a/git-svn.perl\n+++ b/git-svn.perl\n@@ -77,11 +77,12 @@ my %fc_opts = ( 'follow-parent|follow!' => \\$Git::SVN::_follow_parent,\n \t\t   \\$Git::SVN::_repack_flags,\n \t\t%remote_opts );\n \n-my ($_trunk, $_tags, $_branches);\n+my ($_trunk, $_tags, $_branches, $_stdlayout);\n my %icv;\n my %init_opts = ( 'template=s' => \\$_template, 'shared:s' => \\$_shared,\n                   'trunk|T=s' => \\$_trunk, 'tags|t=s' => \\$_tags,\n                   'branches|b=s' => \\$_branches, 'prefix=s' => \\$_prefix,\n+                  'stdlayout|s' => \\$_stdlayout,\n                   'minimize-url|m' => \\$Git::SVN::_minimize_url,\n \t\t  'no-metadata' => sub { $icv{noMetadata} = 1 },\n \t\t  'use-svm-props' => sub { $icv{useSvmProps} = 1 },\n@@ -292,7 +293,8 @@ sub init_subdir {\n sub cmd_clone {\n \tmy ($url, $path) = @_;\n \tif (!defined $path &&\n-\t    (defined $_trunk || defined $_branches || defined $_tags) &&\n+\t    (defined $_trunk || defined $_branches || defined $_tags ||\n+\t     defined $_stdlayout) &&\n \t    $url !~ m#^[a-z\\+]+://#) {\n \t\t$path = $url;\n \t}\n@@ -302,6 +304,11 @@ sub cmd_clone {\n }\n \n sub cmd_init {\n+\tif (defined $_stdlayout) {\n+\t\t$_trunk = 'trunk' if (!defined $_trunk);\n+\t\t$_tags = 'tags' if (!defined $_tags);\n+\t\t$_branches = 'branches' if (!defined $_branches);\n+\t}\n \tif (defined $_trunk || defined $_branches || defined $_tags) {\n \t\treturn cmd_multi_init(@_);\n \t}\n-- \nEric Wong\n"}]}