{"thread":{"id":"25857","subject":"[PATCH] entry.c: remove \"checkout-index\" from error messages","startedAt":"2010-11-28T04:36:38Z","lastAt":"2010-11-28T06:30:47Z","messageCount":2,"participants":["Nguyễn Thái Ngọc Duy","Jeff King"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"156749","messageId":"1290918998-15208-1-git-send-email-pclouds@gmail.com","threadId":"25857","inReplyTo":null,"subject":"[PATCH] entry.c: remove \"checkout-index\" from error messages","fromName":"Nguyễn Thái Ngọc Duy","fromEmail":"pclouds@gmail.com","sentAt":"2010-11-28T04:36:38Z","receivedAt":"2010-11-28T04:36:38Z","isPatch":true,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"Back then when entry.c was part of checkout-index (or checkout-cache\nat that time [1]). It makes sense to print the command name in error\nmessages. Nowadays entry.c is in libgit and can be used by any\ncommands, printing \"git checkout-index: blah\" does no more than\nconfusion. The error messages without it still give enough information.\n\n[1] 12dccc1 (Make fiel checkout function available to the git library - 2005-06-05)\n\nSigned-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>\n---\n I attempted to replace \"git checkout-index\" with the actual command name\n when these functions are called, but I think it's better just removing\n it...\n\n entry.c |   16 ++++++++--------\n 1 files changed, 8 insertions(+), 8 deletions(-)\n\ndiff --git a/entry.c b/entry.c\nindex 004182c..b017167 100644\n--- a/entry.c\n+++ b/entry.c\n@@ -106,14 +106,14 @@ static int write_entry(struct cache_entry *ce, char *path, const struct checkout\n \tcase S_IFLNK:\n \t\tnew = read_blob_entry(ce, &size);\n \t\tif (!new)\n-\t\t\treturn error(\"git checkout-index: unable to read sha1 file of %s (%s)\",\n+\t\t\treturn error(\"unable to read sha1 file of %s (%s)\",\n \t\t\t\tpath, sha1_to_hex(ce->sha1));\n \n \t\tif (ce_mode_s_ifmt == S_IFLNK && has_symlinks && !to_tempfile) {\n \t\t\tret = symlink(new, path);\n \t\t\tfree(new);\n \t\t\tif (ret)\n-\t\t\t\treturn error(\"git checkout-index: unable to create symlink %s (%s)\",\n+\t\t\t\treturn error(\"unable to create symlink %s (%s)\",\n \t\t\t\t\t     path, strerror(errno));\n \t\t\tbreak;\n \t\t}\n@@ -141,7 +141,7 @@ static int write_entry(struct cache_entry *ce, char *path, const struct checkout\n \t\t}\n \t\tif (fd < 0) {\n \t\t\tfree(new);\n-\t\t\treturn error(\"git checkout-index: unable to create file %s (%s)\",\n+\t\t\treturn error(\"unable to create file %s (%s)\",\n \t\t\t\tpath, strerror(errno));\n \t\t}\n \n@@ -155,16 +155,16 @@ static int write_entry(struct cache_entry *ce, char *path, const struct checkout\n \t\tclose(fd);\n \t\tfree(new);\n \t\tif (wrote != size)\n-\t\t\treturn error(\"git checkout-index: unable to write file %s\", path);\n+\t\t\treturn error(\"unable to write file %s\", path);\n \t\tbreak;\n \tcase S_IFGITLINK:\n \t\tif (to_tempfile)\n-\t\t\treturn error(\"git checkout-index: cannot create temporary subproject %s\", path);\n+\t\t\treturn error(\"cannot create temporary subproject %s\", path);\n \t\tif (mkdir(path, 0777) < 0)\n-\t\t\treturn error(\"git checkout-index: cannot create subproject directory %s\", path);\n+\t\t\treturn error(\"cannot create subproject directory %s\", path);\n \t\tbreak;\n \tdefault:\n-\t\treturn error(\"git checkout-index: unknown file mode for %s\", path);\n+\t\treturn error(\"unknown file mode for %s in index\", path);\n \t}\n \n \tif (state->refresh_cache) {\n@@ -211,7 +211,7 @@ int checkout_entry(struct cache_entry *ce, const struct checkout *state, char *t\n \t\t\treturn 0;\n \t\tif (!state->force) {\n \t\t\tif (!state->quiet)\n-\t\t\t\tfprintf(stderr, \"git-checkout-index: %s already exists\\n\", path);\n+\t\t\t\tfprintf(stderr, \"%s already exists, no checkout\\n\", path);\n \t\t\treturn -1;\n \t\t}\n \n-- \n1.7.3.2.316.gda8b3\n"},{"id":"156750","messageId":"20101128063046.GA2902@sigill.intra.peff.net","threadId":"25857","inReplyTo":"1290918998-15208-1-git-send-email-pclouds@gmail.com","subject":"Re: [PATCH] entry.c: remove \"checkout-index\" from error messages","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2010-11-28T06:30:47Z","receivedAt":"2010-11-28T06:30:47Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Sun, Nov 28, 2010 at 11:36:38AM +0700, Nguyễn Thái Ngọc Duy wrote:\n\n> Back then when entry.c was part of checkout-index (or checkout-cache\n> at that time [1]). It makes sense to print the command name in error\n> messages. Nowadays entry.c is in libgit and can be used by any\n> commands, printing \"git checkout-index: blah\" does no more than\n> confusion. The error messages without it still give enough information.\n> \n> [1] 12dccc1 (Make fiel checkout function available to the git library - 2005-06-05)\n> \n> Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>\n> ---\n>  I attempted to replace \"git checkout-index\" with the actual command name\n>  when these functions are called, but I think it's better just removing\n>  it...\n\nAgreed. This came up recently in another thread[1], and I also tracked\nit down to a simple cut-and-paste from the original checkout-index.\n\nAcked-by: Jeff King <peff@peff.net>\n\n-Peff\n\n[1] http://article.gmane.org/gmane.comp.version-control.git/160751\n"}]}