{"thread":{"id":"5130","subject":"update-ref logs: problem with committer info?","startedAt":"2006-08-04T21:01:34Z","lastAt":"2006-08-05T23:55:05Z","messageCount":5,"participants":["Ramsay Jones","Shawn Pearce","Robin Rosenberg"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"24754","messageId":"000501c6b809$2b18cd60$c47eedc1@ramsay1.demon.co.uk","threadId":"5130","inReplyTo":null,"subject":"update-ref logs: problem with committer info?","fromName":"Ramsay Jones","fromEmail":"ramsay@ramsay1.demon.co.uk","sentAt":"2006-08-04T21:01:34Z","receivedAt":"2006-08-04T21:01:34Z","isPatch":false,"sender":{"key":"ramsay@ramsayjones.plus.com","avatar":"https://avatars.githubusercontent.com/u/33702710?v=4"},"body":"Hi all,\n\nAs a follow-up to the previous (two) email, this concerns the ability\nto override the committer info from the config file. As before, this\ndepends on the relative call sites of setup_ident() and git_config().\n\nIn particular, the call to setup_ident(), from log_ref_write(),\nwhich in turn is called from write_ref_sha1() in file refs.c.\nHere, the call to setup_ident() seems to me to be misplaced and to\nalmost guarantee that it will over-write the values set by an\nearlier call to git_config(). It is possible, I suppose, that there\nhas been no previous call to git_config(); just not very likely, and\neven if that were so, then it should be the responsibility of the\n*callers* of write_ref_sha1() to ensure this happens.\n\nIndeed, tracing the callers of write_ref_sha1(), we find cmd_update_ref()\nin builtin-update-ref.c and pull() in fetch.c. Adding a call to\nsetup_ident() in cmd_update_ref() takes care of that route. The callers\nof pull() are to be found in http-fetch.c, local-fetch.c and ssh-fetch.c.\nAdding calls to setup_ident() in these callers is equally simple, so it\nonly remains to remove the call from refs.c.\n\nNow, as in the previous email, I can't compile http-fetch.c or test\nthe result. (Yes, I could test a local fetch, but I'm feeling lazy!)\nIn addition, I feel that somebody who knows the code better than I\nshould take a look.\n\ncomments?\n\nRamsay\n\ndiff --git a/builtin-update-ref.c b/builtin-update-ref.c\nindex 00333c7..83094ab 100644\n--- a/builtin-update-ref.c\n+++ b/builtin-update-ref.c\n@@ -12,6 +12,7 @@ int cmd_update_ref(int argc, const char \n \tunsigned char sha1[20], oldsha1[20];\n \tint i;\n \n+\tsetup_ident();\n \tsetup_git_directory();\n \tgit_config(git_default_config);\n \ndiff --git a/http-fetch.c b/http-fetch.c\nindex 44eba5f..fe3a4fd 100644\n--- a/http-fetch.c\n+++ b/http-fetch.c\n@@ -1222,6 +1222,7 @@ int main(int argc, char **argv)\n \tint arg = 1;\n \tint rc = 0;\n \n+\tsetup_ident();\n \tsetup_git_directory();\n \tgit_config(git_default_config);\n \ndiff --git a/local-fetch.c b/local-fetch.c\nindex ffa4887..d059a51 100644\n--- a/local-fetch.c\n+++ b/local-fetch.c\n@@ -207,6 +207,7 @@ int main(int argc, char **argv)\n \tchar *commit_id;\n \tint arg = 1;\n \n+\tsetup_ident();\n \tsetup_git_directory();\n \tgit_config(git_default_config);\n \ndiff --git a/refs.c b/refs.c\nindex 713ca46..a4060d8 100644\n--- a/refs.c\n+++ b/refs.c\n@@ -379,7 +379,6 @@ static int log_ref_write(struct ref_lock\n \t\t\tlock->log_file, strerror(errno));\n \t}\n \n-\tsetup_ident();\n \tcomitter = git_committer_info(1);\n \tif (msg) {\n \t\tmaxlen = strlen(comitter) + strlen(msg) + 2*40 + 5;\ndiff --git a/ssh-fetch.c b/ssh-fetch.c\nindex 1e59cd2..a42d17e 100644\n--- a/ssh-fetch.c\n+++ b/ssh-fetch.c\n@@ -131,6 +131,7 @@ int main(int argc, char **argv)\n \tprog = getenv(\"GIT_SSH_PUSH\");\n \tif (!prog) prog = \"git-ssh-upload\";\n \n+\tsetup_ident();\n \tsetup_git_directory();\n \tgit_config(git_default_config);\n \n"},{"id":"24787","messageId":"20060805025600.GA18223@spearce.org","threadId":"5130","inReplyTo":"000501c6b809$2b18cd60$c47eedc1@ramsay1.demon.co.uk","subject":"Re: update-ref logs: problem with committer info?","fromName":"Shawn Pearce","fromEmail":"spearce@spearce.org","sentAt":"2006-08-05T02:56:00Z","receivedAt":"2006-08-05T02:56:00Z","isPatch":false,"sender":{"key":"spearce@spearce.org","avatar":"https://avatars.githubusercontent.com/u/34844?v=4"},"body":"Ramsay Jones <ramsay@ramsay1.demon.co.uk> wrote:\n> diff --git a/builtin-update-ref.c b/builtin-update-ref.c\n> index 00333c7..83094ab 100644\n> --- a/builtin-update-ref.c\n> +++ b/builtin-update-ref.c\n> @@ -12,6 +12,7 @@ int cmd_update_ref(int argc, const char \n>  \tunsigned char sha1[20], oldsha1[20];\n>  \tint i;\n>  \n> +\tsetup_ident();\n>  \tsetup_git_directory();\n>  \tgit_config(git_default_config);\n> diff --git a/refs.c b/refs.c\n> index 713ca46..a4060d8 100644\n> --- a/refs.c\n> +++ b/refs.c\n> @@ -379,7 +379,6 @@ static int log_ref_write(struct ref_lock\n>  \t\t\tlock->log_file, strerror(errno));\n>  \t}\n>  \n> -\tsetup_ident();\n>  \tcomitter = git_committer_info(1);\n>  \tif (msg) {\n>  \t\tmaxlen = strlen(comitter) + strlen(msg) + 2*40 + 5;\n\nThese two changes were already fixed by me in 0b0fe4a6 on July\n10th.  That change is in `next`, in `master` and in v1.4.2-rc3.\nSo I expect it to be available in a final release real-soon-now.\nMaybe you should consider running a newer version of GIT?\n\n> diff --git a/http-fetch.c b/http-fetch.c\n> index 44eba5f..fe3a4fd 100644\n> --- a/http-fetch.c\n> +++ b/http-fetch.c\n> @@ -1222,6 +1222,7 @@ int main(int argc, char **argv)\n>  \tint arg = 1;\n>  \tint rc = 0;\n>  \n> +\tsetup_ident();\n>  \tsetup_git_directory();\n>  \tgit_config(git_default_config);\n>  \n> diff --git a/local-fetch.c b/local-fetch.c\n> index ffa4887..d059a51 100644\n> --- a/local-fetch.c\n> +++ b/local-fetch.c\n> @@ -207,6 +207,7 @@ int main(int argc, char **argv)\n>  \tchar *commit_id;\n>  \tint arg = 1;\n>  \n> +\tsetup_ident();\n>  \tsetup_git_directory();\n>  \tgit_config(git_default_config);\n>  \n> diff --git a/ssh-fetch.c b/ssh-fetch.c\n> index 1e59cd2..a42d17e 100644\n> --- a/ssh-fetch.c\n> +++ b/ssh-fetch.c\n> @@ -131,6 +131,7 @@ int main(int argc, char **argv)\n>  \tprog = getenv(\"GIT_SSH_PUSH\");\n>  \tif (!prog) prog = \"git-ssh-upload\";\n>  \n> +\tsetup_ident();\n>  \tsetup_git_directory();\n>  \tgit_config(git_default_config);\n>  \n\nThese changes aren't in `next` right now, but should be.  Junio,\ncan you apply them?\n\n-- \nShawn.\n"},{"id":"24843","messageId":"001a01c6b8cd$0a7b5860$c47eedc1@ramsay1.demon.co.uk","threadId":"5130","inReplyTo":"20060805025600.GA18223@spearce.org","subject":"RE: update-ref logs: problem with committer info?","fromName":"Ramsay Jones","fromEmail":"ramsay@ramsay1.demon.co.uk","sentAt":"2006-08-05T20:23:40Z","receivedAt":"2006-08-05T20:23:40Z","isPatch":false,"sender":{"key":"ramsay@ramsayjones.plus.com","avatar":"https://avatars.githubusercontent.com/u/33702710?v=4"},"body":"\nOn Sat 2006-08-05 at 3:56, spearce@spearce.org wrote:\n\n> Ramsay Jones <ramsay@ramsay1.demon.co.uk> wrote:\n> > diff --git a/builtin-update-ref.c b/builtin-update-ref.c\n> > index 00333c7..83094ab 100644\n> > --- a/builtin-update-ref.c\n> > +++ b/builtin-update-ref.c\n> > @@ -12,6 +12,7 @@ int cmd_update_ref(int argc, const char\n> >  \tunsigned char sha1[20], oldsha1[20];\n> >  \tint i;\n> >\n> > +\tsetup_ident();\n> >  \tsetup_git_directory();\n> >  \tgit_config(git_default_config);\n> > diff --git a/refs.c b/refs.c\n> > index 713ca46..a4060d8 100644\n> > --- a/refs.c\n> > +++ b/refs.c\n> > @@ -379,7 +379,6 @@ static int log_ref_write(struct ref_lock\n> >  \t\t\tlock->log_file, strerror(errno));\n> >  \t}\n> >\n> > -\tsetup_ident();\n> >  \tcomitter = git_committer_info(1);\n> >  \tif (msg) {\n> >  \t\tmaxlen = strlen(comitter) + strlen(msg) + 2*40 + 5;\n>\n> These two changes were already fixed by me in 0b0fe4a6 on July\n> 10th.  That change is in `next`, in `master` and in v1.4.2-rc3.\n> So I expect it to be available in a final release real-soon-now.\n> Maybe you should consider running a newer version of GIT?\n>\n\nYes, I am quite a long way behind, at version 1.4.1, which is light-years\nin git-time!  Unfortunately, since I can't pull from the git repo (I don't\nhave internet access from Linux), I won't be able to update until the v1.4.2\ntar-ball is posted. Yep, not exactly ideal.\n\nOK, for now I will refrain from contributing, at least until v1.4.2 is out.\n\nSorry for the noise.\n\nRamsay\n"},{"id":"24846","messageId":"20060805203304.GB20565@spearce.org","threadId":"5130","inReplyTo":"001a01c6b8cd$0a7b5860$c47eedc1@ramsay1.demon.co.uk","subject":"Re: update-ref logs: problem with committer info?","fromName":"Shawn Pearce","fromEmail":"spearce@spearce.org","sentAt":"2006-08-05T20:33:04Z","receivedAt":"2006-08-05T20:33:04Z","isPatch":false,"sender":{"key":"spearce@spearce.org","avatar":"https://avatars.githubusercontent.com/u/34844?v=4"},"body":"Ramsay Jones <ramsay@ramsay1.demon.co.uk> wrote:\n> \n> Yes, I am quite a long way behind, at version 1.4.1, which is light-years\n> in git-time!  Unfortunately, since I can't pull from the git repo (I don't\n> have internet access from Linux), I won't be able to update until the v1.4.2\n> tar-ball is posted. Yep, not exactly ideal.\n\nYea, that's not much fun.  I found that tracking GIT with GIT is\nreally the easiest way to stay current.  Not having direct net\naccess makes that nearly impossible.\n \n> OK, for now I will refrain from contributing, at least until v1.4.2 is out.\n> \n> Sorry for the noise.\n\nIts not noise, three of your five changes were current bugs that\nneeded fixing.  :-)\n\n-- \nShawn.\n"},{"id":"24853","messageId":"200608060155.06723.robin.rosenberg.lists@dewire.com","threadId":"5130","inReplyTo":"001a01c6b8cd$0a7b5860$c47eedc1@ramsay1.demon.co.uk","subject":"RE: update-ref logs: problem with committer info?","fromName":"Robin Rosenberg","fromEmail":"robin.rosenberg.lists@dewire.com","sentAt":"2006-08-05T23:55:05Z","receivedAt":"2006-08-05T23:55:05Z","isPatch":false,"sender":{"key":"robin.rosenberg@dewire.com","avatar":"https://avatars.githubusercontent.com/u/46357?v=4"},"body":"> Yes, I am quite a long way behind, at version 1.4.1, which is light-years\n> in git-time!  Unfortunately, since I can't pull from the git repo (I don't\n> have internet access from Linux), I won't be able to update until the\n> v1.4.2 tar-ball is posted. Yep, not exactly ideal.\n\nCouldn't you track git with another machine? Then copy that clone to\nyour linux box and then do a local pull from the copied clone. \n\nThere's also the http_proxy, but I guess you know that already.\n\n-- robin\n"}]}