{"thread":{"id":"28348","subject":"git checkout under 1.7.6 does not properly list untracked files and aborts","startedAt":"2011-09-09T20:04:55Z","lastAt":"2011-09-22T05:58:37Z","messageCount":23,"participants":["Joshua Jensen","Michael J Gruber","Nguyen Thai Ngoc Duy","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"175238","messageId":"4E6A7167.6070408@workspacewhiz.com","threadId":"28348","inReplyTo":null,"subject":"git checkout under 1.7.6 does not properly list untracked files and aborts","fromName":"Joshua Jensen","fromEmail":"jjensen@workspacewhiz.com","sentAt":"2011-09-09T20:04:55Z","receivedAt":"2011-09-09T20:04:55Z","isPatch":false,"sender":{"key":"jjensen@workspacewhiz.com","avatar":"https://avatars.githubusercontent.com/u/111687?v=4"},"body":"This may be an msysGit 1.7.6 issue, as that is what I am using.  It also \noccurs in msysGit 1.7.5, but I am almost certain it did not happen in \nmsysGit 1.7.2.\n\nGiven an untracked file in the working directory that has been added to \nan alternate branch, when switching to that alternate branch, 'git \ncheckout' exits with an error code but does not print anything to the \nconsole.  It should print an untracked file error.\n\nI have been trying to track this down in code.  The point where the \nerror messages are printed, display_error_msgs, is never hit.\n\nI don't have a debugger to trace this on Windows, so I've just been \nadding lots of debug output.  So far, I have not found the catalyst.\n\nI am out on vacation now for the next week and a half.  However, I \nthought I would send this along to see if someone else can confirm the \nthe problem.  I'll continue investigation when I'm back.\n\nThanks.\n\nJosh\n"},{"id":"175800","messageId":"4E779BA4.8070109@workspacewhiz.com","threadId":"28348","inReplyTo":"4E6A7167.6070408@workspacewhiz.com","subject":"Re: git checkout under 1.7.6 does not properly list untracked files and aborts","fromName":"Joshua Jensen","fromEmail":"jjensen@workspacewhiz.com","sentAt":"2011-09-19T19:44:36Z","receivedAt":"2011-09-19T19:44:36Z","isPatch":false,"sender":{"key":"jjensen@workspacewhiz.com","avatar":"https://avatars.githubusercontent.com/u/111687?v=4"},"body":"----- Original Message -----\nFrom: Joshua Jensen\nDate: 9/9/2011 2:04 PM\n> This may be an msysGit 1.7.6 issue, as that is what I am using.  It \n> also occurs in msysGit 1.7.5, but I am almost certain it did not \n> happen in msysGit 1.7.2.\n>\n> Given an untracked file in the working directory that has been added \n> to an alternate branch, when switching to that alternate branch, 'git \n> checkout' exits with an error code but does not print anything to the \n> console.  It should print an untracked file error.\n>\n> I have been trying to track this down in code.  The point where the \n> error messages are printed, display_error_msgs, is never hit.\nOkay, so I've tracked this down, but I am unsure what the correct fix is.\n\nIn unpack-trees.c's unpack_trees() function, there are some lines that read:\n\n     if (ce->ce_flags & CE_ADDED &&\n         verify_absent(ce, ERROR_WOULD_LOSE_UNTRACKED_OVERWRITTEN, o))\n             return -1;\n\nIf the 'return -1' is changed to 'goto return_failed', then a proper \nerror message appears:\n\n     error: The following untracked working tree files would be \noverwritten by checkout:\n         one/file/listed/here.txt\n     Please move or remove them before you can switch branches.\n     Aborting\n\nThe thing is, there are multiple files that would be overwritten by \ncheckout, and I believe an older version of Git showed me the entire \nlist before aborting.\n\nWhat would be the proper fix here?  What am I doing wrong?\n\nThanks.\n\nJosh\n"},{"id":"175804","messageId":"4E77A0C6.1060703@workspacewhiz.com","threadId":"28348","inReplyTo":"4E779BA4.8070109@workspacewhiz.com","subject":"Re: git checkout under 1.7.6 does not properly list untracked files and aborts","fromName":"Joshua Jensen","fromEmail":"jjensen@workspacewhiz.com","sentAt":"2011-09-19T20:06:30Z","receivedAt":"2011-09-19T20:06:30Z","isPatch":false,"sender":{"key":"jjensen@workspacewhiz.com","avatar":"https://avatars.githubusercontent.com/u/111687?v=4"},"body":"----- Original Message -----\nFrom: Joshua Jensen\nDate: 9/19/2011 1:44 PM\n> ----- Original Message -----\n> From: Joshua Jensen\n> Date: 9/9/2011 2:04 PM\n>> This may be an msysGit 1.7.6 issue, as that is what I am using.  It \n>> also occurs in msysGit 1.7.5, but I am almost certain it did not \n>> happen in msysGit 1.7.2.\n>>\n>> Given an untracked file in the working directory that has been added \n>> to an alternate branch, when switching to that alternate branch, 'git \n>> checkout' exits with an error code but does not print anything to the \n>> console.  It should print an untracked file error.\n>>\n>> I have been trying to track this down in code.  The point where the \n>> error messages are printed, display_error_msgs, is never hit.\n> Okay, so I've tracked this down, but I am unsure what the correct fix is.\n>\n> In unpack-trees.c's unpack_trees() function, there are some lines that \n> read:\n>\n>     if (ce->ce_flags & CE_ADDED &&\n>         verify_absent(ce, ERROR_WOULD_LOSE_UNTRACKED_OVERWRITTEN, o))\n>             return -1;\n>\n> If the 'return -1' is changed to 'goto return_failed', then a proper \n> error message appears:\n>\n>     error: The following untracked working tree files would be \n> overwritten by checkout:\n>         one/file/listed/here.txt\n>     Please move or remove them before you can switch branches.\n>     Aborting\n>\n> The thing is, there are multiple files that would be overwritten by \n> checkout, and I believe an older version of Git showed me the entire \n> list before aborting.\nWhile probably not correct, the following patch collects all files that \nwould be overwritten and logs them to the output:\n\n---\n  unpack-trees.c |   11 +++++++----\n  1 files changed, 7 insertions(+), 4 deletions(-)\n\ndiff --git a/unpack-trees.c b/unpack-trees.c\nindex cc616c3..e1f7263 100644\n--- a/unpack-trees.c\n+++ b/unpack-trees.c\n@@ -993,7 +993,7 @@ static int verify_absent(struct cache_entry *, enum \nunpack_trees_error_types, st\n   */\n  int unpack_trees(unsigned len, struct tree_desc *t, struct \nunpack_trees_options *o)\n  {\n-    int i, ret;\n+    int i, ret = 0;\n      static struct cache_entry *dfc;\n      struct exclude_list el;\n\n@@ -1100,9 +1100,10 @@ int unpack_trees(unsigned len, struct tree_desc \n*t, struct unpack_trees_options\n               * Do the real check now because we have had\n               * correct CE_NEW_SKIP_WORKTREE\n               */\n-            if (ce->ce_flags & CE_ADDED &&\n-                verify_absent(ce, \nERROR_WOULD_LOSE_UNTRACKED_OVERWRITTEN, o))\n-                    return -1;\n+            if (ce->ce_flags & CE_ADDED) {\n+                int result = verify_absent(ce, \nERROR_WOULD_LOSE_UNTRACKED_OVERWRITTEN, o);\n+                ret = min(ret, result);\n+            }\n\n              if (apply_sparse_checkout(ce, o)) {\n                  ret = -1;\n@@ -1112,6 +1113,8 @@ int unpack_trees(unsigned len, struct tree_desc \n*t, struct unpack_trees_options\n                  empty_worktree = 0;\n\n          }\n+        if (ret == -1)\n+            goto return_failed;\n          if (o->result.cache_nr && empty_worktree) {\n              /* dubious---why should this fail??? */\n              ret = unpack_failed(o, \"Sparse checkout leaves no entry on \nworking directory\");\n-- \n1.7.6.msysgit.1\n"},{"id":"175873","messageId":"4E78ACE2.60306@drmicha.warpmail.net","threadId":"28348","inReplyTo":"4E779BA4.8070109@workspacewhiz.com","subject":"Re: git checkout under 1.7.6 does not properly list untracked files and aborts","fromName":"Michael J Gruber","fromEmail":"git@drmicha.warpmail.net","sentAt":"2011-09-20T15:10:26Z","receivedAt":"2011-09-20T15:10:26Z","isPatch":false,"sender":{"key":"git@grubix.eu","avatar":"https://avatars.githubusercontent.com/u/233215?v=4"},"body":"Joshua Jensen venit, vidit, dixit 19.09.2011 21:44:\n> ----- Original Message -----\n> From: Joshua Jensen\n> Date: 9/9/2011 2:04 PM\n>> This may be an msysGit 1.7.6 issue, as that is what I am using.  It \n>> also occurs in msysGit 1.7.5, but I am almost certain it did not \n>> happen in msysGit 1.7.2.\n>>\n>> Given an untracked file in the working directory that has been added \n>> to an alternate branch, when switching to that alternate branch, 'git \n>> checkout' exits with an error code but does not print anything to the \n>> console.  It should print an untracked file error.\n>>\n>> I have been trying to track this down in code.  The point where the \n>> error messages are printed, display_error_msgs, is never hit.\n> Okay, so I've tracked this down, but I am unsure what the correct fix is.\n> \n> In unpack-trees.c's unpack_trees() function, there are some lines that read:\n> \n>      if (ce->ce_flags & CE_ADDED &&\n>          verify_absent(ce, ERROR_WOULD_LOSE_UNTRACKED_OVERWRITTEN, o))\n>              return -1;\n> \n> If the 'return -1' is changed to 'goto return_failed', then a proper \n> error message appears:\n> \n>      error: The following untracked working tree files would be \n> overwritten by checkout:\n>          one/file/listed/here.txt\n>      Please move or remove them before you can switch branches.\n>      Aborting\n> \n> The thing is, there are multiple files that would be overwritten by \n> checkout, and I believe an older version of Git showed me the entire \n> list before aborting.\n> \n> What would be the proper fix here?  What am I doing wrong?\n\nCan you provide a simple test case, such as this one:\n\n---%<---\n#!/bin/sh\n\nrm -Rf utest || exit 1\nmkdir utest || exit 1\ncd utest || exit 1\ngit init\necho tracked >a\ngit add a\ngit commit -m a a\ngit branch side\necho tracked >b\ngit add b\ngit commit -m b\ncat b\ngit checkout side\ncat b\necho untracked >b\ncat b\ngit checkout master\ncat b\n---%<---\n\nWith 1.7.6 and current next this gives (Linux):\n\nInitialized empty Git repository in /tmp/t/utest/.git/\n[master (root-commit) b462c80] a\n 1 files changed, 1 insertions(+), 0 deletions(-)\n create mode 100644 a\n[master 22d8f2f] b\n 1 files changed, 1 insertions(+), 0 deletions(-)\n create mode 100644 b\ntracked\nSwitched to branch 'side'\ncat: b: No such file or directory\nuntracked\nerror: The following untracked working tree files would be overwritten\nby checkout:\n        b\nPlease move or remove them before you can switch branches.\nAborting\nuntracked\n\nDoes this test reproduce your problem on msysgit?\n\nMichael\n"},{"id":"175876","messageId":"4E78DACF.3030200@workspacewhiz.com","threadId":"28348","inReplyTo":"4E78ACE2.60306@drmicha.warpmail.net","subject":"Re: git checkout under 1.7.6 does not properly list untracked files and aborts","fromName":"Joshua Jensen","fromEmail":"jjensen@workspacewhiz.com","sentAt":"2011-09-20T18:26:23Z","receivedAt":"2011-09-20T18:26:23Z","isPatch":false,"sender":{"key":"jjensen@workspacewhiz.com","avatar":"https://avatars.githubusercontent.com/u/111687?v=4"},"body":"----- Original Message -----\nFrom: Michael J Gruber\nDate: 9/20/2011 9:10 AM\n> Can you provide a simple test case, such as this one:\n>\n> ---%<---\n> #!/bin/sh\n>\n> rm -Rf utest || exit 1\n> mkdir utest || exit 1\n> cd utest || exit 1\n> git init\n> echo tracked>a\n> git add a\n> git commit -m a a\n> git branch side\n> echo tracked>b\n> git add b\n> git commit -m b\n> cat b\n> git checkout side\n> cat b\n> echo untracked>b\n> cat b\n> git checkout master\n> cat b\n> ---%<---\n>\n> Does this test reproduce your problem on msysgit?\nAs listed, your script produces the same results on msysGit.\n\nIt appears the issue is related to sparse checkouts:\n\n---%<---\n#!/bin/sh\n\nrm -Rf utest || exit 1\nmkdir utest || exit 1\ncd utest || exit 1\ngit init\ngit config core.sparseCheckout true\necho *>.git/info/sparse-checkout\necho tracked>a\ngit add a\ngit commit -m a a\ngit branch side\necho tracked>b\ngit add b\ngit commit -m b\ncat b\ngit checkout side\ncat b\necho untracked>b\ncat b\ngit checkout master\ncat b\n---%<---\n\n-Josh\n"},{"id":"175921","messageId":"4E7996AA.4040909@drmicha.warpmail.net","threadId":"28348","inReplyTo":"4E78DACF.3030200@workspacewhiz.com","subject":"Re: git checkout under 1.7.6 does not properly list untracked files and aborts","fromName":"Michael J Gruber","fromEmail":"git@drmicha.warpmail.net","sentAt":"2011-09-21T07:47:54Z","receivedAt":"2011-09-21T07:47:54Z","isPatch":false,"sender":{"key":"git@grubix.eu","avatar":"https://avatars.githubusercontent.com/u/233215?v=4"},"body":"Joshua Jensen venit, vidit, dixit 20.09.2011 20:26:\n> ----- Original Message -----\n> From: Michael J Gruber\n> Date: 9/20/2011 9:10 AM\n>> Can you provide a simple test case, such as this one:\n>>\n>> ---%<---\n>> #!/bin/sh\n>>\n>> rm -Rf utest || exit 1\n>> mkdir utest || exit 1\n>> cd utest || exit 1\n>> git init\n>> echo tracked>a\n>> git add a\n>> git commit -m a a\n>> git branch side\n>> echo tracked>b\n>> git add b\n>> git commit -m b\n>> cat b\n>> git checkout side\n>> cat b\n>> echo untracked>b\n>> cat b\n>> git checkout master\n>> cat b\n>> ---%<---\n>>\n>> Does this test reproduce your problem on msysgit?\n> As listed, your script produces the same results on msysGit.\n> \n> It appears the issue is related to sparse checkouts:\n> \n> ---%<---\n> #!/bin/sh\n> \n> rm -Rf utest || exit 1\n> mkdir utest || exit 1\n> cd utest || exit 1\n> git init\n> git config core.sparseCheckout true\n> echo *>.git/info/sparse-checkout\n> echo tracked>a\n> git add a\n> git commit -m a a\n> git branch side\n> echo tracked>b\n> git add b\n> git commit -m b\n> cat b\n> git checkout side\n> cat b\n> echo untracked>b\n> cat b\n> git checkout master\n> cat b\n> ---%<---\n> \n> -Josh\n\nInteresting. So, it is related to sparse, it seems, and there is also a\nmistake in the documentation (which contradicts itself, btw). With your\nscript, since all files are requested to be checked out ('*'), none\nshould have skip-worktree set, and the result should be the same as with\nmy version. But I get this:\n\nInitialized empty Git repository in /tmp/t/utest/.git/\n[master (root-commit) 5929c8b] a\n 1 files changed, 1 insertions(+), 0 deletions(-)\n create mode 100644 a\n[master 60ad69e] b\n 1 files changed, 1 insertions(+), 0 deletions(-)\n create mode 100644 b\ntracked\nSwitched to branch 'side'\ncat: b: No such file or directory\nuntracked\nuntracked\n\nThat is probably the same output as for you. The final \"git checkout\nmaster\" errored out without doing anything and without message. I'll\nsend a few cleanups now, and do some bisecting and thinking later;\nthough there are people whose sparse-knowledge is way less sparse than\nmine ;)\n\nMichael\n"},{"id":"175922","messageId":"cover.1316590874.git.git@drmicha.warpmail.net","threadId":"28348","inReplyTo":"4E7996AA.4040909@drmicha.warpmail.net","subject":"[PATCH 0/3] read-tree cleanups","fromName":"Michael J Gruber","fromEmail":"git@drmicha.warpmail.net","sentAt":"2011-09-21T07:48:35Z","receivedAt":"2011-09-21T07:48:35Z","isPatch":true,"sender":{"key":"git@grubix.eu","avatar":"https://avatars.githubusercontent.com/u/233215?v=4"},"body":"These are a few cleanups I noticed while checking Joshua's sparse checkout\nproblem when swithcing branches with a dirty sparse tree.\nThey are independent of a possible fix.\n\nMichael J Gruber (3):\n  unpack-trees: print \"Aborting\" to stderr\n  git-read-tree.txt: language and typography fixes\n  git-read-tree.txt: correct sparse-checkout and skip-worktree\n    description\n\n Documentation/git-read-tree.txt |   48 +++++++++++++++++++-------------------\n unpack-trees.c                  |    2 +-\n 2 files changed, 25 insertions(+), 25 deletions(-)\n\n-- \n1.7.7.rc0.469.g9eb94\n"},{"id":"175925","messageId":"8b522de3711f339eea264dd7d8e44682af6c4865.1316590874.git.git@drmicha.warpmail.net","threadId":"28348","inReplyTo":"4E7996AA.4040909@drmicha.warpmail.net","subject":"[PATCH 1/3] unpack-trees: print \"Aborting\" to stderr","fromName":"Michael J Gruber","fromEmail":"git@drmicha.warpmail.net","sentAt":"2011-09-21T07:48:36Z","receivedAt":"2011-09-21T07:48:36Z","isPatch":true,"sender":{"key":"git@grubix.eu","avatar":"https://avatars.githubusercontent.com/u/233215?v=4"},"body":"display_error_msgs() prints all the errors to stderr already (if any),\nfollowed by \"Aborting\" (if any) to stdout. Make the latter go to stderr\ninstead.\n\nSigned-off-by: Michael J Gruber <git@drmicha.warpmail.net>\n---\n unpack-trees.c |    2 +-\n 1 files changed, 1 insertions(+), 1 deletions(-)\n\ndiff --git a/unpack-trees.c b/unpack-trees.c\nindex 670b464..237aed8 100644\n--- a/unpack-trees.c\n+++ b/unpack-trees.c\n@@ -159,7 +159,7 @@ static void display_error_msgs(struct unpack_trees_options *o)\n \t\tstring_list_clear(rejects, 0);\n \t}\n \tif (something_displayed)\n-\t\tprintf(\"Aborting\\n\");\n+\t\tfprintf(stderr, \"Aborting\\n\");\n }\n \n /*\n-- \n1.7.7.rc0.469.g9eb94\n"},{"id":"175924","messageId":"9355aabec087558c4347d012d87e4c678fae148b.1316590874.git.git@drmicha.warpmail.net","threadId":"28348","inReplyTo":"4E7996AA.4040909@drmicha.warpmail.net","subject":"[PATCH 2/3] git-read-tree.txt: language and typography fixes","fromName":"Michael J Gruber","fromEmail":"git@drmicha.warpmail.net","sentAt":"2011-09-21T07:48:37Z","receivedAt":"2011-09-21T07:48:37Z","isPatch":true,"sender":{"key":"git@grubix.eu","avatar":"https://avatars.githubusercontent.com/u/233215?v=4"},"body":"Fix a few missing articles and such, and mark-up 'commands' and `files`\nappropriately.\n\nSigned-off-by: Michael J Gruber <git@drmicha.warpmail.net>\n---\n Documentation/git-read-tree.txt |   40 +++++++++++++++++++-------------------\n 1 files changed, 20 insertions(+), 20 deletions(-)\n\ndiff --git a/Documentation/git-read-tree.txt b/Documentation/git-read-tree.txt\nindex c45d53c..0004f4b 100644\n--- a/Documentation/git-read-tree.txt\n+++ b/Documentation/git-read-tree.txt\n@@ -47,7 +47,7 @@ OPTIONS\n \n -i::\n \tUsually a merge requires the index file as well as the\n-\tfiles in the working tree are up to date with the\n+\tfiles in the working tree to be up to date with the\n \tcurrent head commit, in order not to lose local\n \tchanges.  This flag disables the check with the working\n \ttree and is meant to be used when creating a merge of\n@@ -71,21 +71,21 @@ OPTIONS\n --aggressive::\n \tUsually a three-way merge by 'git read-tree' resolves\n \tthe merge for really trivial cases and leaves other\n-\tcases unresolved in the index, so that Porcelains can\n+\tcases unresolved in the index, so that porcelains can\n \timplement different merge policies.  This flag makes the\n-\tcommand to resolve a few more cases internally:\n+\tcommand resolve a few more cases internally:\n +\n * when one side removes a path and the other side leaves the path\n   unmodified.  The resolution is to remove that path.\n * when both sides remove a path.  The resolution is to remove that path.\n-* when both sides adds a path identically.  The resolution\n+* when both sides add a path identically.  The resolution\n   is to add that path.\n \n --prefix=<prefix>/::\n \tKeep the current index contents, and read the contents\n-\tof named tree-ish under directory at `<prefix>`.  The\n+\tof the named tree-ish under the directory at `<prefix>`. The\n \toriginal index file cannot have anything at the path\n-\t`<prefix>` itself, and have nothing in `<prefix>/`\n+\t`<prefix>` itself, nor anything in the `<prefix>/`\n \tdirectory.  Note that the `<prefix>/` value must end\n \twith a slash.\n \n@@ -379,15 +379,15 @@ have finished your work-in-progress), attempt the merge again.\n Sparse checkout\n ---------------\n \n-\"Sparse checkout\" allows to sparsely populate working directory.\n-It uses skip-worktree bit (see linkgit:git-update-index[1]) to tell\n-Git whether a file on working directory is worth looking at.\n+\"Sparse checkout\" allows populating the working directory sparsely.\n+It uses the skip-worktree bit (see linkgit:git-update-index[1]) to tell\n+Git whether a file in the working directory is worth looking at.\n \n-\"git read-tree\" and other merge-based commands (\"git merge\", \"git\n-checkout\"...) can help maintaining skip-worktree bitmap and working\n+'git read-tree' and other merge-based commands ('git merge', 'git\n+checkout'...) can help maintaining the skip-worktree bitmap and working\n directory update. `$GIT_DIR/info/sparse-checkout` is used to\n-define the skip-worktree reference bitmap. When \"git read-tree\" needs\n-to update working directory, it will reset skip-worktree bit in index\n+define the skip-worktree reference bitmap. When 'git read-tree' needs\n+to update the working directory, it resets the skip-worktree bit in the index\n based on this file, which uses the same syntax as .gitignore files.\n If an entry matches a pattern in this file, skip-worktree will be\n set on that entry. Otherwise, skip-worktree will be unset.\n@@ -397,18 +397,18 @@ skip-worktree turns from unset to set, it will add the corresponding\n file back. If it turns from set to unset, that file will be removed.\n \n While `$GIT_DIR/info/sparse-checkout` is usually used to specify what\n-files are in. You can also specify what files are _not_ in, using\n-negate patterns. For example, to remove file \"unwanted\":\n+files are in, you can also specify what files are _not_ in, using\n+negate patterns. For example, to remove the file `unwanted`:\n \n ----------------\n *\n !unwanted\n ----------------\n \n-Another tricky thing is fully repopulating working directory when you\n+Another tricky thing is fully repopulating the working directory when you\n no longer want sparse checkout. You cannot just disable \"sparse\n-checkout\" because skip-worktree are still in the index and you working\n-directory is still sparsely populated. You should re-populate working\n+checkout\" because skip-worktree bits are still in the index and your working\n+directory is still sparsely populated. You should re-populate the working\n directory with the `$GIT_DIR/info/sparse-checkout` file content as\n follows:\n \n@@ -416,8 +416,8 @@ follows:\n *\n ----------------\n \n-Then you can disable sparse checkout. Sparse checkout support in \"git\n-read-tree\" and similar commands is disabled by default. You need to\n+Then you can disable sparse checkout. Sparse checkout support in 'git\n+read-tree' and similar commands is disabled by default. You need to\n turn `core.sparseCheckout` on in order to have sparse checkout\n support.\n \n-- \n1.7.7.rc0.469.g9eb94\n"},{"id":"175923","messageId":"31152a2ddb83e37be1efce1d0cd742b71ea3efdd.1316590874.git.git@drmicha.warpmail.net","threadId":"28348","inReplyTo":"4E7996AA.4040909@drmicha.warpmail.net","subject":"[PATCH 3/3] git-read-tree.txt: correct sparse-checkout and skip-worktree description","fromName":"Michael J Gruber","fromEmail":"git@drmicha.warpmail.net","sentAt":"2011-09-21T07:48:38Z","receivedAt":"2011-09-21T07:48:38Z","isPatch":true,"sender":{"key":"git@grubix.eu","avatar":"https://avatars.githubusercontent.com/u/233215?v=4"},"body":"The description of .git/info/sparse-checkout and\nskip-worktree is exactly the opposite of what is true, which is:\n\nIf a file matches a pattern in sparse-checkout, then (it is to be\nchecked out and therefore) skip-worktree is unset for that file;\notherwise, it is set (so that it is not checked out).\n\nCurrently, the opposite is documented, and (consistently) read-tree's\nbehavior with respect to bit flips is descibed incorrectly.\n\nFix it.\n\nIn hindsight, it would have been much better to have a \"sparse-ignore\"\nor \"sparse-skip\" file so that an empty file would mean a full checkout,\nand the file logic would be analogous to that of .gitignore, excludes\nand skip-worktree.\n\nSigned-off-by: Michael J Gruber <git@drmicha.warpmail.net>\n---\n Documentation/git-read-tree.txt |    8 ++++----\n 1 files changed, 4 insertions(+), 4 deletions(-)\n\ndiff --git a/Documentation/git-read-tree.txt b/Documentation/git-read-tree.txt\nindex 0004f4b..1bd0317 100644\n--- a/Documentation/git-read-tree.txt\n+++ b/Documentation/git-read-tree.txt\n@@ -389,12 +389,12 @@ directory update. `$GIT_DIR/info/sparse-checkout` is used to\n define the skip-worktree reference bitmap. When 'git read-tree' needs\n to update the working directory, it resets the skip-worktree bit in the index\n based on this file, which uses the same syntax as .gitignore files.\n-If an entry matches a pattern in this file, skip-worktree will be\n-set on that entry. Otherwise, skip-worktree will be unset.\n+If an entry matches a pattern in this file, skip-worktree will not be\n+set on that entry. Otherwise, skip-worktree will be set.\n \n Then it compares the new skip-worktree value with the previous one. If\n-skip-worktree turns from unset to set, it will add the corresponding\n-file back. If it turns from set to unset, that file will be removed.\n+skip-worktree turns from set to unset, it will add the corresponding\n+file back. If it turns from unset to set, that file will be removed.\n \n While `$GIT_DIR/info/sparse-checkout` is usually used to specify what\n files are in, you can also specify what files are _not_ in, using\n-- \n1.7.7.rc0.469.g9eb94\n"},{"id":"175926","messageId":"4E799799.8060106@drmicha.warpmail.net","threadId":"28348","inReplyTo":"cover.1316590874.git.git@drmicha.warpmail.net","subject":"Re: [PATCH 0/3] read-tree cleanups","fromName":"Michael J Gruber","fromEmail":"git@drmicha.warpmail.net","sentAt":"2011-09-21T07:51:53Z","receivedAt":"2011-09-21T07:51:53Z","isPatch":true,"sender":{"key":"git@grubix.eu","avatar":"https://avatars.githubusercontent.com/u/233215?v=4"},"body":"Michael J Gruber venit, vidit, dixit 21.09.2011 09:48:\n> These are a few cleanups I noticed while checking Joshua's sparse checkout\n> problem when swithcing branches with a dirty sparse tree.\n> They are independent of a possible fix.\n> \n> Michael J Gruber (3):\n>   unpack-trees: print \"Aborting\" to stderr\n>   git-read-tree.txt: language and typography fixes\n>   git-read-tree.txt: correct sparse-checkout and skip-worktree\n>     description\n> \n>  Documentation/git-read-tree.txt |   48 +++++++++++++++++++-------------------\n>  unpack-trees.c                  |    2 +-\n>  2 files changed, 25 insertions(+), 25 deletions(-)\n> \n\nUhm, I forgot about the dont-cc-jc-in-rc policy, sorry. This is not a\nlate-minute regression fix and can wait.\n\nMichael\n"},{"id":"175927","messageId":"4E79A04B.7080607@drmicha.warpmail.net","threadId":"28348","inReplyTo":"4E7996AA.4040909@drmicha.warpmail.net","subject":"Re: git checkout under 1.7.6 does not properly list untracked files and aborts","fromName":"Michael J Gruber","fromEmail":"git@drmicha.warpmail.net","sentAt":"2011-09-21T08:28:59Z","receivedAt":"2011-09-21T08:28:59Z","isPatch":false,"sender":{"key":"git@grubix.eu","avatar":"https://avatars.githubusercontent.com/u/233215?v=4"},"body":"Michael J Gruber venit, vidit, dixit 21.09.2011 09:47:\n\n> Interesting. So, it is related to sparse, it seems, and there is also a\n> mistake in the documentation (which contradicts itself, btw). With your\n> script, since all files are requested to be checked out ('*'), none\n> should have skip-worktree set, and the result should be the same as with\n> my version. But I get this:\n> \n> Initialized empty Git repository in /tmp/t/utest/.git/\n> [master (root-commit) 5929c8b] a\n>  1 files changed, 1 insertions(+), 0 deletions(-)\n>  create mode 100644 a\n> [master 60ad69e] b\n>  1 files changed, 1 insertions(+), 0 deletions(-)\n>  create mode 100644 b\n> tracked\n> Switched to branch 'side'\n> cat: b: No such file or directory\n> untracked\n> untracked\n> \n> That is probably the same output as for you. The final \"git checkout\n> master\" errored out without doing anything and without message. I'll\n> send a few cleanups now, and do some bisecting and thinking later;\n> though there are people whose sparse-knowledge is way less sparse than\n> mine ;)\n\nSo, I bisected it. The first bad commit is\n\n9037026 (unpack-trees: fix sparse checkout's \"unable to match\ndirectories\", 2010-11-27)\n\nalthough the real culprit may be its predecessor\n\n2431afb (unpack-trees: move all skip-worktree checks back to\nunpack_trees(), 2010-11-27)\n\nwhich does not compile:\n\n    CC unpack-trees.o\nunpack-trees.c: In function 'mark_new_skip_worktree':\nunpack-trees.c:852:75: error: 'o' undeclared (first use in this function)\nunpack-trees.c:852:75: note: each undeclared identifier is reported only\nonce for each function it appears in\nmake: *** [unpack-trees.o] Error 1\n\nSo, this problem was introduced after v1.7.3.2. Given the extent of\nthose two commits, I can't help further (but your proposed fix may be fine).\n\nDuy, sorry for prodding you again. My bisect script was (based on\nJoshua's, based on mine):\n\n#!/bin/sh\nGIT_EXEC_DIR=~/src/git\nPATH=$GIT_EXEC_DIR:$PATH\nexport GIT_EXEC_DIR\nd=/tmp/t/utest\nrm -Rf $d || exit 1\nmkdir $d || exit 1\ncd $d || exit 1\ngit init\ngit config core.sparseCheckout true\necho *>.git/info/sparse-checkout\necho tracked>a\ngit add a\ngit commit -m a a\ngit branch side\necho tracked>b\ngit add b\ngit commit -m b\ngit checkout side\necho untracked>b\ngit checkout master 2>&1 | grep \"would be\"\n\nHope this helps.\n\nMichael\n"},{"id":"175928","messageId":"20110921085842.GA29768@duynguyen-vnpc","threadId":"28348","inReplyTo":"4E79A04B.7080607@drmicha.warpmail.net","subject":"Re: git checkout under 1.7.6 does not properly list untracked files and aborts","fromName":"Nguyen Thai Ngoc Duy","fromEmail":"pclouds@gmail.com","sentAt":"2011-09-21T08:58:42Z","receivedAt":"2011-09-21T08:58:42Z","isPatch":false,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"On Wed, Sep 21, 2011 at 10:28:59AM +0200, Michael J Gruber wrote:\n> So, I bisected it. The first bad commit is\n> \n> 9037026 (unpack-trees: fix sparse checkout's \"unable to match\n> directories\", 2010-11-27)\n> \n> although the real culprit may be its predecessor\n> \n> 2431afb (unpack-trees: move all skip-worktree checks back to\n> unpack_trees(), 2010-11-27)\n> \n> which does not compile:\n> \n>     CC unpack-trees.o\n> unpack-trees.c: In function 'mark_new_skip_worktree':\n> unpack-trees.c:852:75: error: 'o' undeclared (first use in this function)\n> unpack-trees.c:852:75: note: each undeclared identifier is reported only\n> once for each function it appears in\n> make: *** [unpack-trees.o] Error 1\n\nThis may help\n\n--8<--\ndiff --git a/unpack-trees.c b/unpack-trees.c\nindex a6518db..a239af7 100644\n--- a/unpack-trees.c\n+++ b/unpack-trees.c\n@@ -245,13 +245,13 @@ static int check_updates(struct unpack_trees_options *o)\n static int verify_uptodate_sparse(struct cache_entry *ce, struct unpack_trees_options *o);\n static int verify_absent_sparse(struct cache_entry *ce, enum unpack_trees_error_types, struct unpack_trees_options *o);\n \n-static int will_have_skip_worktree(const struct cache_entry *ce, struct unpack_trees_options *o)\n+static int will_have_skip_worktree(const struct cache_entry *ce, struct exclude_list *el)\n {\n \tconst char *basename;\n \n \tbasename = strrchr(ce->name, '/');\n \tbasename = basename ? basename+1 : ce->name;\n-\treturn excluded_from_list(ce->name, ce_namelen(ce), basename, NULL, o->el) <= 0;\n+\treturn excluded_from_list(ce->name, ce_namelen(ce), basename, NULL, el) <= 0;\n }\n\n static int apply_sparse_checkout(struct cache_entry *ce, struct unpack_trees_options *o)\n@@ -849,7 +849,7 @@ static void mark_new_skip_worktree(struct exclude_list *el,\n \t\tif (select_flag && !(ce->ce_flags & select_flag))\n \t\t\tcontinue;\n \n-\t\tif (!ce_stage(ce) && will_have_skip_worktree(ce, o))\n+\t\tif (!ce_stage(ce) && will_have_skip_worktree(ce, el))\n \t\t\tce->ce_flags |= skip_wt_flag;\n \t\telse\n \t\t\tce->ce_flags &= ~skip_wt_flag;\n--8<--\n\n> Duy, sorry for prodding you again.\n\nNo problem (and sorry for breaking the build). I'll also have a look\nat this problem.\n"},{"id":"175929","messageId":"4E79AB5F.5020809@drmicha.warpmail.net","threadId":"28348","inReplyTo":"20110921085842.GA29768@duynguyen-vnpc","subject":"Re: git checkout under 1.7.6 does not properly list untracked files and aborts","fromName":"Michael J Gruber","fromEmail":"git@drmicha.warpmail.net","sentAt":"2011-09-21T09:16:15Z","receivedAt":"2011-09-21T09:16:15Z","isPatch":false,"sender":{"key":"git@grubix.eu","avatar":"https://avatars.githubusercontent.com/u/233215?v=4"},"body":"Nguyen Thai Ngoc Duy venit, vidit, dixit 21.09.2011 10:58:\n> On Wed, Sep 21, 2011 at 10:28:59AM +0200, Michael J Gruber wrote:\n>> So, I bisected it. The first bad commit is\n>>\n>> 9037026 (unpack-trees: fix sparse checkout's \"unable to match\n>> directories\", 2010-11-27)\n>>\n>> although the real culprit may be its predecessor\n>>\n>> 2431afb (unpack-trees: move all skip-worktree checks back to\n>> unpack_trees(), 2010-11-27)\n>>\n>> which does not compile:\n>>\n>>     CC unpack-trees.o\n>> unpack-trees.c: In function 'mark_new_skip_worktree':\n>> unpack-trees.c:852:75: error: 'o' undeclared (first use in this function)\n>> unpack-trees.c:852:75: note: each undeclared identifier is reported only\n>> once for each function it appears in\n>> make: *** [unpack-trees.o] Error 1\n> \n> This may help\n> \n> --8<--\n> diff --git a/unpack-trees.c b/unpack-trees.c\n> index a6518db..a239af7 100644\n> --- a/unpack-trees.c\n> +++ b/unpack-trees.c\n> @@ -245,13 +245,13 @@ static int check_updates(struct unpack_trees_options *o)\n>  static int verify_uptodate_sparse(struct cache_entry *ce, struct unpack_trees_options *o);\n>  static int verify_absent_sparse(struct cache_entry *ce, enum unpack_trees_error_types, struct unpack_trees_options *o);\n>  \n> -static int will_have_skip_worktree(const struct cache_entry *ce, struct unpack_trees_options *o)\n> +static int will_have_skip_worktree(const struct cache_entry *ce, struct exclude_list *el)\n>  {\n>  \tconst char *basename;\n>  \n>  \tbasename = strrchr(ce->name, '/');\n>  \tbasename = basename ? basename+1 : ce->name;\n> -\treturn excluded_from_list(ce->name, ce_namelen(ce), basename, NULL, o->el) <= 0;\n> +\treturn excluded_from_list(ce->name, ce_namelen(ce), basename, NULL, el) <= 0;\n>  }\n> \n>  static int apply_sparse_checkout(struct cache_entry *ce, struct unpack_trees_options *o)\n> @@ -849,7 +849,7 @@ static void mark_new_skip_worktree(struct exclude_list *el,\n>  \t\tif (select_flag && !(ce->ce_flags & select_flag))\n>  \t\t\tcontinue;\n>  \n> -\t\tif (!ce_stage(ce) && will_have_skip_worktree(ce, o))\n> +\t\tif (!ce_stage(ce) && will_have_skip_worktree(ce, el))\n>  \t\t\tce->ce_flags |= skip_wt_flag;\n>  \t\telse\n>  \t\t\tce->ce_flags &= ~skip_wt_flag;\n> --8<--\n> \n>> Duy, sorry for prodding you again.\n> \n> No problem (and sorry for breaking the build). I'll also have a look\n> at this problem.\n\nThanks. I can confirm that with the above patch, the code compiles and\nfails my test. So it's the earlier of the two commits which introduces this.\n\nMichael\n"},{"id":"175931","messageId":"CACsJy8BrBsBM-DwC_CkYrrpFU6aTqpcohWDPxTnRhMEX+w3Nug@mail.gmail.com","threadId":"28348","inReplyTo":"31152a2ddb83e37be1efce1d0cd742b71ea3efdd.1316590874.git.git@drmicha.warpmail.net","subject":"Re: [PATCH 3/3] git-read-tree.txt: correct sparse-checkout and skip-worktree description","fromName":"Nguyen Thai Ngoc Duy","fromEmail":"pclouds@gmail.com","sentAt":"2011-09-21T09:26:04Z","receivedAt":"2011-09-21T09:26:04Z","isPatch":true,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"On Wed, Sep 21, 2011 at 5:48 PM, Michael J Gruber\n<git@drmicha.warpmail.net> wrote:\n> The description of .git/info/sparse-checkout and\n> skip-worktree is exactly the opposite of what is true, which is:\n>\n> If a file matches a pattern in sparse-checkout, then (it is to be\n> checked out and therefore) skip-worktree is unset for that file;\n> otherwise, it is set (so that it is not checked out).\n>\n> Currently, the opposite is documented, and (consistently) read-tree's\n> behavior with respect to bit flips is descibed incorrectly.\n>\n> Fix it.\n\nAck.\n\n> In hindsight, it would have been much better to have a \"sparse-ignore\"\n> or \"sparse-skip\" file so that an empty file would mean a full checkout,\n> and the file logic would be analogous to that of .gitignore, excludes\n> and skip-worktree.\n\n.gitignore works towards excluding files. No rule means no excluding.\nsparse-checkout file works towards including files, no rule means no\ninclusion.\n-- \nDuy\n"},{"id":"175932","messageId":"4E79AF57.3010300@drmicha.warpmail.net","threadId":"28348","inReplyTo":"CACsJy8BrBsBM-DwC_CkYrrpFU6aTqpcohWDPxTnRhMEX+w3Nug@mail.gmail.com","subject":"Re: [PATCH 3/3] git-read-tree.txt: correct sparse-checkout and skip-worktree description","fromName":"Michael J Gruber","fromEmail":"git@drmicha.warpmail.net","sentAt":"2011-09-21T09:33:11Z","receivedAt":"2011-09-21T09:33:11Z","isPatch":true,"sender":{"key":"git@grubix.eu","avatar":"https://avatars.githubusercontent.com/u/233215?v=4"},"body":"Nguyen Thai Ngoc Duy venit, vidit, dixit 21.09.2011 11:26:\n> On Wed, Sep 21, 2011 at 5:48 PM, Michael J Gruber\n> <git@drmicha.warpmail.net> wrote:\n>> The description of .git/info/sparse-checkout and\n>> skip-worktree is exactly the opposite of what is true, which is:\n>>\n>> If a file matches a pattern in sparse-checkout, then (it is to be\n>> checked out and therefore) skip-worktree is unset for that file;\n>> otherwise, it is set (so that it is not checked out).\n>>\n>> Currently, the opposite is documented, and (consistently) read-tree's\n>> behavior with respect to bit flips is descibed incorrectly.\n>>\n>> Fix it.\n> \n> Ack.\n> \n>> In hindsight, it would have been much better to have a \"sparse-ignore\"\n>> or \"sparse-skip\" file so that an empty file would mean a full checkout,\n>> and the file logic would be analogous to that of .gitignore, excludes\n>> and skip-worktree.\n> \n> .gitignore works towards excluding files. No rule means no excluding.\n> sparse-checkout file works towards including files, no rule means no\n> inclusion.\n\nSure, but with a \"sparse-skip\" rather than \"sparse-checkout\", we would\nnot even need an additional config variable, and the skip-worktree\ncentered explanations would follow the same logic (no need for the\nadditional negation) as the ignore files and the new sparse-skip file.\nAlso, I'm not sure whether more sparse users say \"I want only that\nsubdir.\" than \"I don't want that subdir.\"\n\nBut it's there to stay, of course.\n\nCheers,\nMichael\n"},{"id":"175934","messageId":"CACsJy8AmvgjCwEikB-0NOf5gV+fcnFsAnhtYj6w6y8kfHu9b9Q@mail.gmail.com","threadId":"28348","inReplyTo":"4E79AF57.3010300@drmicha.warpmail.net","subject":"Re: [PATCH 3/3] git-read-tree.txt: correct sparse-checkout and skip-worktree description","fromName":"Nguyen Thai Ngoc Duy","fromEmail":"pclouds@gmail.com","sentAt":"2011-09-21T09:39:34Z","receivedAt":"2011-09-21T09:39:34Z","isPatch":true,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"On Wed, Sep 21, 2011 at 7:33 PM, Michael J Gruber\n<git@drmicha.warpmail.net> wrote:\n>>> In hindsight, it would have been much better to have a \"sparse-ignore\"\n>>> or \"sparse-skip\" file so that an empty file would mean a full checkout,\n>>> and the file logic would be analogous to that of .gitignore, excludes\n>>> and skip-worktree.\n>>\n>> .gitignore works towards excluding files. No rule means no excluding.\n>> sparse-checkout file works towards including files, no rule means no\n>> inclusion.\n>\n> Sure, but with a \"sparse-skip\" rather than \"sparse-checkout\", we would\n> not even need an additional config variable, and the skip-worktree\n> centered explanations would follow the same logic (no need for the\n> additional negation) as the ignore files and the new sparse-skip file.\n\nI'll kill that config variable some day when sparse checkout code has\nno overhead over normal case (\"include all\").\n-- \nDuy\n"},{"id":"175936","messageId":"20110921102834.GA21353@duynguyen-vnpc","threadId":"28348","inReplyTo":"4E79AB5F.5020809@drmicha.warpmail.net","subject":"Re: git checkout under 1.7.6 does not properly list untracked files and aborts","fromName":"Nguyen Thai Ngoc Duy","fromEmail":"pclouds@gmail.com","sentAt":"2011-09-21T10:28:34Z","receivedAt":"2011-09-21T10:28:34Z","isPatch":false,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"On Wed, Sep 21, 2011 at 11:16:15AM +0200, Michael J Gruber wrote:\n> Thanks. I can confirm that with the above patch, the code compiles and\n> fails my test. So it's the earlier of the two commits which introduces this.\n\nI was afraid some logic had gone horribly wrong. Turns out I did not\ncatch up with unpack_trees() coding style and drop the error messages\nso \"git checkout\" in this case becomes \"git checkout -q\".\n\nThis patch should fix it. Need another look before I submit a real\npatch though.\n\ndiff --git a/unpack-trees.c b/unpack-trees.c\nindex cc616c3..79e9e88 100644\n--- a/unpack-trees.c\n+++ b/unpack-trees.c\n@@ -1102,12 +1102,10 @@ int unpack_trees(unsigned len, struct tree_desc *t, struct unpack_trees_options\n \t\t\t */\n \t\t\tif (ce->ce_flags & CE_ADDED &&\n \t\t\t    verify_absent(ce, ERROR_WOULD_LOSE_UNTRACKED_OVERWRITTEN, o))\n-\t\t\t\t\treturn -1;\n+\t\t\t\tgoto return_failed;\n \n-\t\t\tif (apply_sparse_checkout(ce, o)) {\n-\t\t\t\tret = -1;\n-\t\t\t\tgoto done;\n-\t\t\t}\n+\t\t\tif (apply_sparse_checkout(ce, o))\n+\t\t\t\tgoto return_failed;\n \t\t\tif (!ce_skip_worktree(ce))\n \t\t\t\tempty_worktree = 0;\n \n"},{"id":"175937","messageId":"CACsJy8A76Cd6Yjr9PnYn9-iVHaJa9vnnjViF_SDFeiZZWONjow@mail.gmail.com","threadId":"28348","inReplyTo":"20110921102834.GA21353@duynguyen-vnpc","subject":"Re: git checkout under 1.7.6 does not properly list untracked files and aborts","fromName":"Nguyen Thai Ngoc Duy","fromEmail":"pclouds@gmail.com","sentAt":"2011-09-21T10:31:53Z","receivedAt":"2011-09-21T10:31:53Z","isPatch":false,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"On Wed, Sep 21, 2011 at 8:28 PM, Nguyen Thai Ngoc Duy <pclouds@gmail.com> wrote:\n> I was afraid some logic had gone horribly wrong. Turns out I did not\n> catch up with unpack_trees() coding style and drop the error messages\n> so \"git checkout\" in this case becomes \"git checkout -q\".\n\nGaah.. if I did read Joshua's problem description, it would not need\nto worry about the logic. He said it returned error code correctly.\nSilly me.\n-- \nDuy\n"},{"id":"175942","messageId":"7vaa9y2hom.fsf@alter.siamese.dyndns.org","threadId":"28348","inReplyTo":"4E799799.8060106@drmicha.warpmail.net","subject":"Re: [PATCH 0/3] read-tree cleanups","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2011-09-21T12:14:06Z","receivedAt":"2011-09-21T12:14:06Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Michael J Gruber <git@drmicha.warpmail.net> writes:\n\n> Uhm, I forgot about the dont-cc-jc-in-rc policy, sorry. This is not a\n> late-minute regression fix and can wait.\n\nThanks but that is not a policy; merely my preference.  It also is a bit\nunnecessarily stronger than my actual preferences, which is\n\n (1) I do not want to see a patch sent \"To:\" me as the maintainer the\n     first round of a new, undiscussed patch, as if it is ready for\n     inclusion, at any time, not just during rc.\n\n (2) I do appreciate a patch sent \"Cc:\" me as a member of the development\n     community patches for discussion, especially to areas in which I am\n     an area expert, at any time, including during rc.\n"},{"id":"175966","messageId":"7v7h511rl9.fsf@alter.siamese.dyndns.org","threadId":"28348","inReplyTo":"8b522de3711f339eea264dd7d8e44682af6c4865.1316590874.git.git@drmicha.warpmail.net","subject":"Re: [PATCH 1/3] unpack-trees: print \"Aborting\" to stderr","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2011-09-21T22:02:58Z","receivedAt":"2011-09-21T22:02:58Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Forgot to update a test or two that this breaks?\n"},{"id":"175967","messageId":"7v39fp1pvd.fsf@alter.siamese.dyndns.org","threadId":"28348","inReplyTo":"7v7h511rl9.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH 1/3] unpack-trees: print \"Aborting\" to stderr","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2011-09-21T22:40:06Z","receivedAt":"2011-09-21T22:40:06Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Junio C Hamano <gitster@pobox.com> writes:\n\n> Forgot to update a test or two that this breaks?\n\nIn the meantime I've squashed this in.\n\n t/t7607-merge-overwrite.sh     |    1 +\n t/t7609-merge-co-error-msgs.sh |    5 +++++\n 2 files changed, 6 insertions(+), 0 deletions(-)\n\ndiff --git a/t/t7607-merge-overwrite.sh b/t/t7607-merge-overwrite.sh\nindex 72a8731..aa74184 100755\n--- a/t/t7607-merge-overwrite.sh\n+++ b/t/t7607-merge-overwrite.sh\n@@ -107,6 +107,7 @@ error: The following untracked working tree files would be overwritten by merge:\n \tsub\n \tsub2\n Please move or remove them before you can merge.\n+Aborting\n EOF\n \n test_expect_success 'will not overwrite untracked file in leading path' '\ndiff --git a/t/t7609-merge-co-error-msgs.sh b/t/t7609-merge-co-error-msgs.sh\nindex c994836..0e4a682 100755\n--- a/t/t7609-merge-co-error-msgs.sh\n+++ b/t/t7609-merge-co-error-msgs.sh\n@@ -32,6 +32,7 @@ error: The following untracked working tree files would be overwritten by merge:\n \tthree\n \ttwo\n Please move or remove them before you can merge.\n+Aborting\n EOF\n \n test_expect_success 'untracked files overwritten by merge (fast and non-fast forward)' '\n@@ -56,6 +57,7 @@ Please, commit your changes or stash them before you can merge.\n error: The following untracked working tree files would be overwritten by merge:\n \tfive\n Please move or remove them before you can merge.\n+Aborting\n EOF\n \n test_expect_success 'untracked files or local changes ovewritten by merge' '\n@@ -71,6 +73,7 @@ error: Your local changes to the following files would be overwritten by checkou\n \trep/one\n \trep/two\n Please, commit your changes or stash them before you can switch branches.\n+Aborting\n EOF\n \n test_expect_success 'cannot switch branches because of local changes' '\n@@ -92,6 +95,7 @@ error: Your local changes to the following files would be overwritten by checkou\n \trep/one\n \trep/two\n Please, commit your changes or stash them before you can switch branches.\n+Aborting\n EOF\n \n test_expect_success 'not uptodate file porcelain checkout error' '\n@@ -105,6 +109,7 @@ error: Updating the following directories would lose untracked files in it:\n \trep\n \trep2\n \n+Aborting\n EOF\n \n test_expect_success 'not_uptodate_dir porcelain checkout error' '\n"},{"id":"175986","messageId":"4E7ACE8D.8070001@drmicha.warpmail.net","threadId":"28348","inReplyTo":"7v39fp1pvd.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH 1/3] unpack-trees: print \"Aborting\" to stderr","fromName":"Michael J Gruber","fromEmail":"git@drmicha.warpmail.net","sentAt":"2011-09-22T05:58:37Z","receivedAt":"2011-09-22T05:58:37Z","isPatch":true,"sender":{"key":"git@grubix.eu","avatar":"https://avatars.githubusercontent.com/u/233215?v=4"},"body":"Junio C Hamano venit, vidit, dixit 22.09.2011 00:40:\n> Junio C Hamano <gitster@pobox.com> writes:\n> \n>> Forgot to update a test or two that this breaks?\n> \n> In the meantime I've squashed this in.\n\nYikes. Sorry and thanks!\n\n> \n>  t/t7607-merge-overwrite.sh     |    1 +\n>  t/t7609-merge-co-error-msgs.sh |    5 +++++\n>  2 files changed, 6 insertions(+), 0 deletions(-)\n> \n> diff --git a/t/t7607-merge-overwrite.sh b/t/t7607-merge-overwrite.sh\n> index 72a8731..aa74184 100755\n> --- a/t/t7607-merge-overwrite.sh\n> +++ b/t/t7607-merge-overwrite.sh\n> @@ -107,6 +107,7 @@ error: The following untracked working tree files would be overwritten by merge:\n>  \tsub\n>  \tsub2\n>  Please move or remove them before you can merge.\n> +Aborting\n>  EOF\n>  \n>  test_expect_success 'will not overwrite untracked file in leading path' '\n> diff --git a/t/t7609-merge-co-error-msgs.sh b/t/t7609-merge-co-error-msgs.sh\n> index c994836..0e4a682 100755\n> --- a/t/t7609-merge-co-error-msgs.sh\n> +++ b/t/t7609-merge-co-error-msgs.sh\n> @@ -32,6 +32,7 @@ error: The following untracked working tree files would be overwritten by merge:\n>  \tthree\n>  \ttwo\n>  Please move or remove them before you can merge.\n> +Aborting\n>  EOF\n>  \n>  test_expect_success 'untracked files overwritten by merge (fast and non-fast forward)' '\n> @@ -56,6 +57,7 @@ Please, commit your changes or stash them before you can merge.\n>  error: The following untracked working tree files would be overwritten by merge:\n>  \tfive\n>  Please move or remove them before you can merge.\n> +Aborting\n>  EOF\n>  \n>  test_expect_success 'untracked files or local changes ovewritten by merge' '\n> @@ -71,6 +73,7 @@ error: Your local changes to the following files would be overwritten by checkou\n>  \trep/one\n>  \trep/two\n>  Please, commit your changes or stash them before you can switch branches.\n> +Aborting\n>  EOF\n>  \n>  test_expect_success 'cannot switch branches because of local changes' '\n> @@ -92,6 +95,7 @@ error: Your local changes to the following files would be overwritten by checkou\n>  \trep/one\n>  \trep/two\n>  Please, commit your changes or stash them before you can switch branches.\n> +Aborting\n>  EOF\n>  \n>  test_expect_success 'not uptodate file porcelain checkout error' '\n> @@ -105,6 +109,7 @@ error: Updating the following directories would lose untracked files in it:\n>  \trep\n>  \trep2\n>  \n> +Aborting\n>  EOF\n>  \n>  test_expect_success 'not_uptodate_dir porcelain checkout error' '\n"}]}