{"thread":{"id":"10812","subject":"[PATCH] git-svn: prevent dcommitting if the index is dirty.","startedAt":"2007-11-11T18:41:41Z","lastAt":"2007-11-17T20:52:48Z","messageCount":4,"participants":["Benoit Sigoure","Eric Wong"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"59357","messageId":"1194806501-4796-1-git-send-email-tsuna@lrde.epita.fr","threadId":"10812","inReplyTo":null,"subject":"[PATCH] git-svn: prevent dcommitting if the index is dirty.","fromName":"Benoit Sigoure","fromEmail":"tsuna@lrde.epita.fr","sentAt":"2007-11-11T18:41:41Z","receivedAt":"2007-11-11T18:41:41Z","isPatch":true,"sender":{"key":"tsunanet@gmail.com","avatar":"https://avatars.githubusercontent.com/u/128281?v=4"},"body":"dcommit uses rebase `sync' the history with what has just been pushed to\nSVN.  Trying to dcommit with a dirty index is troublesome for rebase, so now\nthe user will get an error message if he attempts to dcommit with a dirty\nindex.\n\nSigned-off-by: Benoit Sigoure <tsuna@lrde.epita.fr>\n---\n git-svn.perl                              |    3 +++\n t/t9106-git-svn-dcommit-clobber-series.sh |    6 ++++++\n 2 files changed, 9 insertions(+), 0 deletions(-)\n\ndiff --git a/git-svn.perl b/git-svn.perl\nindex dd93e32..a15df4f 100755\n--- a/git-svn.perl\n+++ b/git-svn.perl\n@@ -390,6 +390,9 @@ sub cmd_set_tree {\n \n sub cmd_dcommit {\n \tmy $head = shift;\n+        git_cmd_try { command_oneline(qw/diff-index --quiet HEAD/) }\n+          'Cannot dcommit with a dirty index.  Commit your changes first'\n+          . \"or stash them with `git stash'.\\n\";\n \t$head ||= 'HEAD';\n \tmy @refs;\n \tmy ($url, $rev, $uuid, $gs) = working_head_info($head, \\@refs);\ndiff --git a/t/t9106-git-svn-dcommit-clobber-series.sh b/t/t9106-git-svn-dcommit-clobber-series.sh\nindex 7eff4cd..44fae3b 100755\n--- a/t/t9106-git-svn-dcommit-clobber-series.sh\n+++ b/t/t9106-git-svn-dcommit-clobber-series.sh\n@@ -53,4 +53,10 @@ test_expect_success 'change file but in unrelated area' \"\n \t\ttest x\\\"\\`sed -n -e 61p < file\\`\\\" = x6611\n \t\"\n \n+test_expect_failure 'attempt to dcommit with a dirty index' \"\n+\techo foo >>file &&\n+\tgit add file &&\n+\tgit svn dcommit\n+\t\"\n+\n test_done\n-- \n1.5.3.5.654.gdd5ec\n"},{"id":"59417","messageId":"20071112022851.GA25675@mayonaise","threadId":"10812","inReplyTo":"1194806501-4796-1-git-send-email-tsuna@lrde.epita.fr","subject":"Re: [PATCH] git-svn: prevent dcommitting if the index is dirty.","fromName":"Eric Wong","fromEmail":"normalperson@yhbt.net","sentAt":"2007-11-12T02:28:51Z","receivedAt":"2007-11-12T02:28:51Z","isPatch":true,"sender":{"key":"e@80x24.org","avatar":null},"body":"Benoit Sigoure <tsuna@lrde.epita.fr> wrote:\n> dcommit uses rebase `sync' the history with what has just been pushed to\n> SVN.  Trying to dcommit with a dirty index is troublesome for rebase, so now\n> the user will get an error message if he attempts to dcommit with a dirty\n> index.\n> \n> Signed-off-by: Benoit Sigoure <tsuna@lrde.epita.fr>\n\nThanks,\n\nMinor nit below about indentation (which Junio can fix when applying),\nbut nevertheless:\n\nAcked-by: Eric Wong <normalperson@yhbt.net>\n\n> ---\n>  git-svn.perl                              |    3 +++\n>  t/t9106-git-svn-dcommit-clobber-series.sh |    6 ++++++\n>  2 files changed, 9 insertions(+), 0 deletions(-)\n> \n> diff --git a/git-svn.perl b/git-svn.perl\n> index dd93e32..a15df4f 100755\n> --- a/git-svn.perl\n> +++ b/git-svn.perl\n> @@ -390,6 +390,9 @@ sub cmd_set_tree {\n>  \n>  sub cmd_dcommit {\n>  \tmy $head = shift;\n> +        git_cmd_try { command_oneline(qw/diff-index --quiet HEAD/) }\n> +          'Cannot dcommit with a dirty index.  Commit your changes first'\n> +          . \"or stash them with `git stash'.\\n\";\n\nWe use tabs for indentation, and spaces for alignment.\n\n>  \t$head ||= 'HEAD';\n>  \tmy @refs;\n>  \tmy ($url, $rev, $uuid, $gs) = working_head_info($head, \\@refs);\n\n-- \nEric Wong\n"},{"id":"59443","messageId":"F711CC72-4A91-4B69-B26A-31B0FB6621B0@lrde.epita.fr","threadId":"10812","inReplyTo":"20071112022851.GA25675@mayonaise","subject":"Re: [PATCH] git-svn: prevent dcommitting if the index is dirty.","fromName":"Benoit Sigoure","fromEmail":"tsuna@lrde.epita.fr","sentAt":"2007-11-12T09:11:03Z","receivedAt":"2007-11-12T09:11:03Z","isPatch":true,"sender":{"key":"tsunanet@gmail.com","avatar":"https://avatars.githubusercontent.com/u/128281?v=4"},"body":"On Nov 12, 2007, at 3:28 AM, Eric Wong wrote:\n\n> Benoit Sigoure <tsuna@lrde.epita.fr> wrote:\n>> dcommit uses rebase `sync' the history with what has just been  \n>> pushed to\n>> SVN.  Trying to dcommit with a dirty index is troublesome for  \n>> rebase, so now\n>> the user will get an error message if he attempts to dcommit with  \n>> a dirty\n>> index.\n>>\n>> Signed-off-by: Benoit Sigoure <tsuna@lrde.epita.fr>\n>\n> Thanks,\n>\n> Minor nit below about indentation (which Junio can fix when applying),\n> but nevertheless:\n>\n> Acked-by: Eric Wong <normalperson@yhbt.net>\n>\n>> ---\n>>  git-svn.perl                              |    3 +++\n>>  t/t9106-git-svn-dcommit-clobber-series.sh |    6 ++++++\n>>  2 files changed, 9 insertions(+), 0 deletions(-)\n>>\n>> diff --git a/git-svn.perl b/git-svn.perl\n>> index dd93e32..a15df4f 100755\n>> --- a/git-svn.perl\n>> +++ b/git-svn.perl\n>> @@ -390,6 +390,9 @@ sub cmd_set_tree {\n>>\n>>  sub cmd_dcommit {\n>>  \tmy $head = shift;\n>> +        git_cmd_try { command_oneline(qw/diff-index --quiet HEAD/) }\n>> +          'Cannot dcommit with a dirty index.  Commit your  \n>> changes first'\n>> +          . \"or stash them with `git stash'.\\n\";\n>\n> We use tabs for indentation, and spaces for alignment.\n\nYes, sorry again, would you consider to add `# vi: set noexpandtab:'  \nat the end of the file so that ViM users (like me) don't have to  \nthink about it?  (it tells ViM to NOT expand tabs to series of spaces)\n\n-- \nBenoit Sigoure aka Tsuna\nEPITA Research and Development Laboratory\n\n\n"},{"id":"60168","messageId":"20071117205248.GA31598@mayonaise","threadId":"10812","inReplyTo":"F711CC72-4A91-4B69-B26A-31B0FB6621B0@lrde.epita.fr","subject":"Re: [PATCH] git-svn: prevent dcommitting if the index is dirty.","fromName":"Eric Wong","fromEmail":"normalperson@yhbt.net","sentAt":"2007-11-17T20:52:48Z","receivedAt":"2007-11-17T20:52:48Z","isPatch":true,"sender":{"key":"e@80x24.org","avatar":null},"body":"Benoit Sigoure <tsuna@lrde.epita.fr> wrote:\n> On Nov 12, 2007, at 3:28 AM, Eric Wong wrote:\n> >We use tabs for indentation, and spaces for alignment.\n> \n> Yes, sorry again, would you consider to add `# vi: set noexpandtab:'  \n> at the end of the file so that ViM users (like me) don't have to  \n> think about it?  (it tells ViM to NOT expand tabs to series of spaces)\n\nNo, there are still too many cases where the modelines won't apply:\nnon-VIM users, VIM-users with modelines disabled.\n\nInstead, you can try this in your .vimrc:\n\naugroup filetype\n\tau BufRead git-svn.perl\t\tset noexpandtab\naugroup END\n\n-- \nEric Wong\n"}]}