{"thread":{"id":"43558","subject":"Re: [PATCH] Make logAllRefUpdates true by default","startedAt":"2006-11-26T15:36:43Z","lastAt":"2006-11-27T05:01:00Z","messageCount":3,"participants":["Junio C Hamano","Anand Kumria","Shawn Pearce"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"297624","messageId":"11645554033331-git-send-email-wildfire@progsoc.org","threadId":"43558","inReplyTo":null,"subject":"[PATCH] Make logAllRefUpdates true by default","fromName":"Anand Kumria","fromEmail":"wildfire@progsoc.org","sentAt":"2006-11-26T15:36:43Z","receivedAt":"2006-11-26T15:36:43Z","isPatch":true,"sender":{"key":"wildfire@progsoc.org","avatar":null},"body":"reflog support, which allows you to determine what the state of a branch\nwas at a particular date/time, is often cited as something that would be\nuseful to have on by default.  Modify git init-db, so that newly created\nrepositories have this on.\n\nSigned-off-by: Anand Kumria <wildfire@progsoc.org>\n---\n Documentation/config.txt |    2 +-\n builtin-init-db.c        |    3 +++\n 2 files changed, 4 insertions(+), 1 deletions(-)\n\ndiff --git a/Documentation/config.txt b/Documentation/config.txt\nindex 9d3c71c..e8d0bc1 100644\n--- a/Documentation/config.txt\n+++ b/Documentation/config.txt\n@@ -80,7 +80,7 @@ core.logAllRefUpdates::\n \n \tThis information can be used to determine what commit\n \twas the tip of a branch \"2 days ago\".  This value is\n-\tfalse by default (no automated creation of log files).\n+\ttrue by default.\n \n core.repositoryFormatVersion::\n \tInternal variable identifying the repository format and layout\ndiff --git a/builtin-init-db.c b/builtin-init-db.c\nindex 235a0ee..4ea865d 100644\n--- a/builtin-init-db.c\n+++ b/builtin-init-db.c\n@@ -239,6 +239,9 @@ static void create_default_files(const c\n \t\tgit_config_set(\"core.filemode\",\n \t\t\t       filemode ? \"true\" : \"false\");\n \t}\n+\n+\tgit_config_set(\"core.logAllRefUpdates\", \"true\");\n+\n }\n \n static const char init_db_usage[] =\n-- \n1.4.3.3\n"},{"id":"295504","messageId":"7vhcwmt19w.fsf@assigned-by-dhcp.cox.net","threadId":"43558","inReplyTo":"11645554033331-git-send-email-wildfire@progsoc.org","subject":"Re: [PATCH] Make logAllRefUpdates true by default","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2006-11-26T20:12:59Z","receivedAt":"2006-11-26T20:12:59Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"I do not think I can take this patch in its current form.\n\nAlthough I think majority of users would find it convenient to\nhave ref-log enabled by default on repositories to be developed\nin, it does not make sense to enable ref-log by default for bare\nrepositories that is used as a distribution point.  So at least\nthis needs an option to disable it (if you make it the default),\nor enable it.\n\n        Side note.  A ref-log at a distribution point _could_ be\n        used for somebody to say \"Hey, I pushed that fix three\n        days ago -- why are you complaining about the breakage\n        I've already fixed before checking the public tip?\", but\n        that is a manifestation of lack of communication among\n        people and a SCM is not about solving that problem.\n\nBut having to add an option tends to drive people nuts.  We\nalready have --shared and --template, so adding --with-reflog\nwould be \"just one more option\" that we may not have to worry\ntoo much about, but we would have to revisit this as we gain\nmore experience using git and more best-current-practices are\nlearned.  I wonder if we can infer if a particular invocation of\ninit-db is to prepare a repository to be developed in without\nbeing told with a command line option.  If we can do so, then we\ncan do the configuratio setting with --with-reflog=[yes|no|guess]\noption (and lack of --with-reflog means \"guess\").\n\nThere are three use cases that init-db is run directly from the\ncommand line, and I think you want different behaviours.\n\n (1) you have a directory, perhaps already with many files\n     there, because you are doing an initial import to prepare a\n     repository to work in.  You obviously want a ref-log there,\n     and you want --shared=no.  You do not care about\n     denyNonFastForwards because you are not likely to be\n     pushing into it.\n\n (2) you are preparing a public distribution point for _your_\n     own tree.  You do not want a ref-log, you want --shared=no,\n     and you _might_ want denyNonFastForwards.\n\n (3) you are preparing a public shared repository for project\n     members to use to synchronize, CVS-style.  You do not want\n     a ref-log, you do want --shared=group, and and you want\n     denyNonFastForwards.\n\nAnother case that init-db is run indirectly is via git-clone and\nvia foreign SCM importers.  I think enabling ref-log during\nnon-bare clone, for example, should behave similarly to (1)\nbecause the resulting repository is clearly meant to be used\nwith a working tree in which to develop.  A bare clone is either\n(2) or (3) but you do not have to decide what to do with ref-log\n(i.e. \"don't\").  But in these \"indirect\" cases, the command that\ndrives init-db can explicitly tell init-db what it is doing, and\nwe would need to have both --with-reflog and --without-reflog\noptions so that the command can tell what it wants from init-db\nexplicitly without having init-db guess.\n\nIf you can come up with a reliable way to tell (1)..(3) then we\ncan make init-db to do the right thing without an end user to\ntell what should happen --with-reflog or --without-reflog; and\nthey do not even have to say --shared anymore as an added bonus.\n\nHaving thought about all the above, I think the event to create\ndistribution/synchronization point repositories are rare enough\nand the simplest and cleanest way might be to make it default\nand add a --without-reflog option to the command, and forget\nabout the guessing.\n\n"},{"id":"297709","messageId":"20061127050059.GA18970@spearce.org","threadId":"43558","inReplyTo":"7vhcwmt19w.fsf@assigned-by-dhcp.cox.net","subject":"Re: [PATCH] Make logAllRefUpdates true by default","fromName":"Shawn Pearce","fromEmail":"spearce@spearce.org","sentAt":"2006-11-27T05:01:00Z","receivedAt":"2006-11-27T05:01:00Z","isPatch":true,"sender":{"key":"spearce@spearce.org","avatar":"https://avatars.githubusercontent.com/u/34844?v=4"},"body":"Junio C Hamano <junkio@cox.net> wrote:\n> I do not think I can take this patch in its current form.\n> \n> Although I think majority of users would find it convenient to\n> have ref-log enabled by default on repositories to be developed\n> in, it does not make sense to enable ref-log by default for bare\n> repositories that is used as a distribution point.  So at least\n> this needs an option to disable it (if you make it the default),\n> or enable it.\n\nWhat about just suggesting that the individual user run:\n\n\tgit repo-config --global core.logAllRefUpdates true\n\n?\n\nThis has the effect of enabling reflog by default for any repository\nthat the user creates or clones, unless its explicitly disabled in\nthat repository.\n\nI've done this in any account that I use to access working directory\nrepositories and it works well.  But I also just realized that I have\nit enabled in one account which also pushes to some bare repositories\nthrough local filesystem URLs and thus those bare repositories are\nalso getting reflogged.  But given that they are used as backups of\nmy working directory repositories (different drive) and are never\npruned, I actually consider that to be a feature.  :-)\n\nYour idea of guessing the intent of the repository and setting up the\nconfiguration based on that intent is a good one, but unfortunately I\nhave no suggestions for how to solve the (1)..(3) cases you raised.\nBut setting core.logAllRefUpdates in the global configuration of\nan interactive account appears to be a reasonable workaround.\n\n-- \n"}]}