{"thread":{"id":"58519","subject":"[PATCH] abspath.h is created.","startedAt":"2022-09-27T16:10:34Z","lastAt":"2022-09-28T17:59:10Z","messageCount":5,"participants":["skrab-sah via GitGitGadget","Junio C Hamano","Skrab Sah","Taylor Blau"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"463733","messageId":"pull.1345.git.git.1664294909011.gitgitgadget@gmail.com","threadId":"58519","inReplyTo":null,"subject":"[PATCH] abspath.h is created.","fromName":"skrab-sah via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2022-09-27T16:08:28Z","receivedAt":"2022-09-27T16:10:34Z","isPatch":true,"sender":{"key":"name:skrab-sah","avatar":null},"body":"From: skrab-sah <skrab.sah@gmail.com>\n\nreplaced declaration of abspath.c from cache.h to abspath.h.\nabspath.h is  generated by using makeheaders tool.\n\nSigned-off-by: skrab-sah <skrab.sah@gmail.com>\n---\n    abspath.h file is generated by makeheaders tool\n    \n     1. we don't need to commit the file.\n     2. added routin for abspath.c in Makefile.\n\nPublished-As: https://github.com/gitgitgadget/git/releases/tag/pr-git-1345%2Fskrab-sah%2Fmaster-v1\nFetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-git-1345/skrab-sah/master-v1\nPull-Request: https://github.com/git/git/pull/1345\n\n abspath.c | 10 ++++++++++\n abspath.h |  9 +++++++++\n cache.h   | 21 +--------------------\n 3 files changed, 20 insertions(+), 20 deletions(-)\n create mode 100644 abspath.h\n\ndiff --git a/abspath.c b/abspath.c\nindex 39e06b58486..1c163bbe651 100644\n--- a/abspath.c\n+++ b/abspath.c\n@@ -262,6 +262,16 @@ char *absolute_pathdup(const char *path)\n \treturn strbuf_detach(&sb, NULL);\n }\n \n+/*\n+ * Concatenate \"prefix\" (if len is non-zero) and \"path\", with no\n+ * connecting characters (so \"prefix\" should end with a \"/\").\n+ * Unlike prefix_path, this should be used if the named file does\n+ * not have to interact with index entry; i.e. name of a random file\n+ * on the filesystem.\n+ *\n+ * The return value is always a newly allocated string (even if the\n+ * prefix was empty).\n+ */\n char *prefix_filename(const char *pfx, const char *arg)\n {\n \tstruct strbuf path = STRBUF_INIT;\ndiff --git a/abspath.h b/abspath.h\nnew file mode 100644\nindex 00000000000..edebc3a53ba\n--- /dev/null\n+++ b/abspath.h\n@@ -0,0 +1,9 @@\n+/* \u0007This file was automatically generated.  Do not edit! */\n+#undef INTERFACE\n+char *prefix_filename(const char *pfx,const char *arg);\n+char *absolute_pathdup(const char *path);\n+const char *absolute_path(const char *path);\n+char *real_pathdup(const char *path,int die_on_error);\n+char *strbuf_realpath_forgiving(struct strbuf *resolved,const char *path,int die_on_error);\n+char *strbuf_realpath(struct strbuf *resolved,const char *path,int die_on_error);\n+int is_directory(const char *path);\ndiff --git a/cache.h b/cache.h\nindex 26ed03bd6de..e226dbcc7d5 100644\n--- a/cache.h\n+++ b/cache.h\n@@ -646,18 +646,6 @@ const char *setup_git_directory(void);\n char *prefix_path(const char *prefix, int len, const char *path);\n char *prefix_path_gently(const char *prefix, int len, int *remaining, const char *path);\n \n-/*\n- * Concatenate \"prefix\" (if len is non-zero) and \"path\", with no\n- * connecting characters (so \"prefix\" should end with a \"/\").\n- * Unlike prefix_path, this should be used if the named file does\n- * not have to interact with index entry; i.e. name of a random file\n- * on the filesystem.\n- *\n- * The return value is always a newly allocated string (even if the\n- * prefix was empty).\n- */\n-char *prefix_filename(const char *prefix, const char *path);\n-\n int check_filename(const char *prefix, const char *name);\n void verify_filename(const char *prefix,\n \t\t     const char *name,\n@@ -1299,14 +1287,7 @@ static inline int is_absolute_path(const char *path)\n {\n \treturn is_dir_sep(path[0]) || has_dos_drive_prefix(path);\n }\n-int is_directory(const char *);\n-char *strbuf_realpath(struct strbuf *resolved, const char *path,\n-\t\t      int die_on_error);\n-char *strbuf_realpath_forgiving(struct strbuf *resolved, const char *path,\n-\t\t\t\tint die_on_error);\n-char *real_pathdup(const char *path, int die_on_error);\n-const char *absolute_path(const char *path);\n-char *absolute_pathdup(const char *path);\n+#include \"abspath.h\"\n const char *remove_leading_path(const char *in, const char *prefix);\n const char *relative_path(const char *in, const char *prefix, struct strbuf *sb);\n int normalize_path_copy_len(char *dst, const char *src, int *prefix_len);\n\nbase-commit: 4fd6c5e44459e6444c2cd93383660134c95aabd1\n-- \ngitgitgadget\n"},{"id":"463780","messageId":"xmqq8rm41gbp.fsf@gitster.g","threadId":"58519","inReplyTo":"pull.1345.git.git.1664294909011.gitgitgadget@gmail.com","subject":"Re: [PATCH] abspath.h is created.","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2022-09-28T00:40:58Z","receivedAt":"2022-09-28T00:41:04Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"skrab-sah via GitGitGadget\" <gitgitgadget@gmail.com> writes:\n\n> diff --git a/abspath.h b/abspath.h\n> new file mode 100644\n> index 00000000000..edebc3a53ba\n> --- /dev/null\n> +++ b/abspath.h\n> @@ -0,0 +1,9 @@\n> +/* \u0007This file was automatically generated.  Do not edit! */\n\nNo thanks.\n\nI suspect this change is taking us in a wrong direction.  People\ngrep for function and struct declarations in <*.h> files and expect\nto find the associated comments.\n"},{"id":"463797","messageId":"CA+J78MXbXG4M1w50EAM8t0VkYP_saCt9O90jFKad3+cB+RCZ-Q@mail.gmail.com","threadId":"58519","inReplyTo":"xmqq8rm41gbp.fsf@gitster.g","subject":"Re: [PATCH] abspath.h is created.","fromName":"Skrab Sah","fromEmail":"skrab.sah@gmail.com","sentAt":"2022-09-28T07:32:22Z","receivedAt":"2022-09-28T07:34:18Z","isPatch":true,"sender":{"key":"skrab.sah@gmail.com","avatar":null},"body":"What is wrong here and what should i do to make it correct.\n\nOn Wed, 28 Sept 2022 at 06:11, Junio C Hamano <gitster@pobox.com> wrote:\n>\n> \"skrab-sah via GitGitGadget\" <gitgitgadget@gmail.com> writes:\n>\n> > diff --git a/abspath.h b/abspath.h\n> > new file mode 100644\n> > index 00000000000..edebc3a53ba\n> > --- /dev/null\n> > +++ b/abspath.h\n> > @@ -0,0 +1,9 @@\n> > +/*  This file was automatically generated.  Do not edit! */\n>\n> No thanks.\n>\n> I suspect this change is taking us in a wrong direction.  People\n> grep for function and struct declarations in <*.h> files and expect\n> to find the associated comments.\n"},{"id":"463849","messageId":"YzRqt2rxdhfG9CdX@nand.local","threadId":"58519","inReplyTo":"CA+J78MXbXG4M1w50EAM8t0VkYP_saCt9O90jFKad3+cB+RCZ-Q@mail.gmail.com","subject":"Re: [PATCH] abspath.h is created.","fromName":"Taylor Blau","fromEmail":"me@ttaylorr.com","sentAt":"2022-09-28T15:39:35Z","receivedAt":"2022-09-28T15:39:53Z","isPatch":true,"sender":{"key":"me@ttaylorr.com","avatar":"https://avatars.githubusercontent.com/u/301000140?v=4"},"body":"Hi Skrab,\n\nOn Wed, Sep 28, 2022 at 01:02:22PM +0530, Skrab Sah wrote:\n> What is wrong here and what should i do to make it correct.\n\nI suspect that Junio's concern is that it appears the tool you're using\nto auto-generate these .h files moves the comments away from the\ndeclaration and into the header.\n\nI imagine that such a change would be improved if:\n\n  - You kept the comment attached to the function declaration (and\n    ensured that it was present in the header file).\n\n  - And we dropped the \"this file is auto-generated by ...\" comment,\n    since I don't imagine that folks will be interested in adding a new\n    tool to the development toolchain.\n\nThanks.\n\n\nTaylor\n"},{"id":"463867","messageId":"xmqqpmfftm7a.fsf@gitster.g","threadId":"58519","inReplyTo":"CA+J78MXbXG4M1w50EAM8t0VkYP_saCt9O90jFKad3+cB+RCZ-Q@mail.gmail.com","subject":"Re: [PATCH] abspath.h is created.","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2022-09-28T17:58:49Z","receivedAt":"2022-09-28T17:59:10Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Skrab Sah <skrab.sah@gmail.com> writes:\n\n> What is wrong here and what should i do to make it correct.\n\nAlmost everything in what the patch is wrong.\n\n * It creates <abspath.h> as a tracked file, but has a funny comment\n   with control-G in it that says \"do not edit\"\n\n * It is entirely unclear how the contents of <abspath.h> is meant\n   to evolve, if the contributors are forbidden to edit it, and\n   without any instruction how to update it.\n\n * The new <abspath.h> lost all function comments, grouping by\n   category, etc. that were in the original <cache.h>.\n\n * There is an \"#undef INTERFACE\" that has no use to us, those who\n   develop Git, for no clearly explained reason.\n\n * The proposed log message says what it did, but it does not even\n   try to justify why it is a good idea to do so.\n\n * There is no need to create a new <abspath.h> in the first place.\n   If we were in an alternate world where we did not have\n   <abspath.c>, it may be reasonable to add <abspath.h> along with\n   it, instead of adding declarations for new functions and types in\n   <cache.h>.  But the difference falls into \"once it is in, it is\n   not worth the patch churn to change it\" category.\n\nThe easiest way to make it correct is to drop it, I guess.\n\nThanks.\n\n"}]}