{"thread":{"id":"2639","subject":"[RFC] Make grafts versionable","startedAt":"2005-11-21T20:54:51Z","lastAt":"2005-11-22T00:37:44Z","messageCount":5,"participants":["Johannes Schindelin","H. Peter Anvin","Linus Torvalds"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"12470","messageId":"Pine.LNX.4.63.0511212152110.4611@wbgn013.biozentrum.uni-wuerzburg.de","threadId":"2639","inReplyTo":null,"subject":"[RFC] Make grafts versionable","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2005-11-21T20:54:51Z","receivedAt":"2005-11-21T20:54:51Z","isPatch":false,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"\n... by moving the location from .git/info/grafts to .gitgrafts. This \nallows checking it in like .gitignore, and sure enough also pulling it (as \nwell as knowing who the heck added that particular graft anyway).\n\nTotally untested.\n\nSigned-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>\n\n---\n\n\tThis would make half the discussion about rewriting history\n\tobsolete, methinks.\n\n\tOf course, to take advantage of it, you have to move the file \n\t.git/info/grafts (if it exists) into the correct place yourself:\n\n\t\tmv -i .git/info/grafts .gitgrafts\n\n environment.c |    2 +-\n 1 files changed, 1 insertions(+), 1 deletions(-)\n\napplies-to: 20259f7c4418392e0e0c2f3a867811f657498afe\na1756142e3be780ed7992cd6a3f5e64b53c42253\ndiff --git a/environment.c b/environment.c\nindex b5026f1..b0c2f79 100644\n--- a/environment.c\n+++ b/environment.c\n@@ -35,7 +35,7 @@ static void setup_git_env(void)\n \t}\n \tgit_graft_file = getenv(GRAFT_ENVIRONMENT);\n \tif (!git_graft_file)\n-\t\tgit_graft_file = strdup(git_path(\"info/grafts\"));\n+\t\tgit_graft_file = strdup(git_path(\"../.gitgrafts\"));\n }\n \n char *get_git_dir(void)\n---\n0.99.9.GIT\n"},{"id":"12472","messageId":"43823654.2060904@zytor.com","threadId":"2639","inReplyTo":"Pine.LNX.4.63.0511212152110.4611@wbgn013.biozentrum.uni-wuerzburg.de","subject":"Re: [RFC] Make grafts versionable","fromName":"H. Peter Anvin","fromEmail":"hpa@zytor.com","sentAt":"2005-11-21T21:04:20Z","receivedAt":"2005-11-21T21:04:20Z","isPatch":false,"sender":{"key":"hpa@zytor.com","avatar":null},"body":"Johannes Schindelin wrote:\n> ... by moving the location from .git/info/grafts to .gitgrafts. This \n> allows checking it in like .gitignore, and sure enough also pulling it (as \n> well as knowing who the heck added that particular graft anyway).\n\nThis is problematic, because it means something that isn't in GIT_DIR \naffects its interpretation.  I would say that that is a showstopper.\n\nOne could even argue that it's incorrect, since it would mean different \npoints on the history have different grafts.\n\nNow, CVS has a reserved namespace (CVSROOT/) for things under version \ncontrol which are still significant to CVS.  The logical equivalent to \ngit would be to have .git/ be such a namespace, if it makes sense.\n\n\t-hpa\n"},{"id":"12477","messageId":"Pine.LNX.4.64.0511211326110.13959@g5.osdl.org","threadId":"2639","inReplyTo":"43823654.2060904@zytor.com","subject":"Re: [RFC] Make grafts versionable","fromName":"Linus Torvalds","fromEmail":"torvalds@osdl.org","sentAt":"2005-11-21T21:35:46Z","receivedAt":"2005-11-21T21:35:46Z","isPatch":false,"sender":{"key":"torvalds@linux-foundation.org","avatar":"https://avatars.githubusercontent.com/u/1024025?v=4"},"body":"\n\nOn Mon, 21 Nov 2005, H. Peter Anvin wrote:\n> \n> Now, CVS has a reserved namespace (CVSROOT/) for things under version control\n> which are still significant to CVS.  The logical equivalent to git would be to\n> have .git/ be such a namespace, if it makes sense.\n\nWell, there's two reasons for disallowing git from tracking it's own .git \ndirectory:\n\n - it protects against people doing somethin glike\n\n\tgit-update-cache --add -- $(find . -type f | cut -c3..)\n\n   and finding the pre-existing files in \".git\"\n\n   This used to literally be how I imported trees into git. These days, \n   you can just do it with \"git-ls-files --others\", and in fact that is \n   exactly what \"git add\" does, so now you can just do\n\n\tgit add .\n\n   and be done with it - without getting that \".git\" directory by mistake.\n\n   So that _old_ reason may not be as valid any more.\n\nHowever, there's one fundamental reason:\n\n - if you have a file in \".git\", that implies that even a \"raw git repo\" \n   would have versions matter, since technically such a file would be \n   inside the \"raw\" part. And that I find to be confusing. One of the \n   whole points of a raw git repo is that because it doesn't have anything \n   that is version-controlled and checked out, none of the branches or \n   tags are special, and nothing needs to be updated when you push to such \n   a repo.\n\n   Now, if you have files in .git, suddenly that fundamental nature of a \n   raw repository is no longer clear.\n\nIn general, making any internal git data versionable is very confusing. So \nyou make the grafts file versionable - that suddenly means that different \nbranches may have different parents for the same commit. And that \ndepending on which branch you have checked out, git-fsck-cache may result \nin an error, or it may not. That's _nasty_, in my opinion.\n\nSo I much prefer to say: everything under \".git\" is not versionable, for \nthe fundamental reason that the files under .git are \"global\" to that git \nrepository. \n\nAnd I think .git/grafts in particular makes no sense to version.\n\nIf you want to track a git \"grafts\" file, you can do it as another git \nrepository and a symlink.\n\n\t\tLinus\n"},{"id":"12481","messageId":"43823EF6.6010302@zytor.com","threadId":"2639","inReplyTo":"Pine.LNX.4.64.0511211326110.13959@g5.osdl.org","subject":"Re: [RFC] Make grafts versionable","fromName":"H. Peter Anvin","fromEmail":"hpa@zytor.com","sentAt":"2005-11-21T21:41:10Z","receivedAt":"2005-11-21T21:41:10Z","isPatch":false,"sender":{"key":"hpa@zytor.com","avatar":null},"body":"Linus Torvalds wrote:\n> \n> However, there's one fundamental reason:\n> \n>  - if you have a file in \".git\", that implies that even a \"raw git repo\" \n>    would have versions matter, since technically such a file would be \n>    inside the \"raw\" part. And that I find to be confusing. One of the \n>    whole points of a raw git repo is that because it doesn't have anything \n>    that is version-controlled and checked out, none of the branches or \n>    tags are special, and nothing needs to be updated when you push to such \n>    a repo.\n> \n>    Now, if you have files in .git, suddenly that fundamental nature of a \n>    raw repository is no longer clear.\n> \n\nNote that I didn't actually mean that they should necessarily represent \nfiles in .git/.  The point was more that if we wanted to have \nversion-controlled metadata, using .git/ as a namespace would be suitable.\n\nIn particular, I believe that if we ever do that, git should obtain this \nmetadata from the repository/object database.\n\n> In general, making any internal git data versionable is very confusing. So \n> you make the grafts file versionable - that suddenly means that different \n> branches may have different parents for the same commit. And that \n> depending on which branch you have checked out, git-fsck-cache may result \n> in an error, or it may not. That's _nasty_, in my opinion.\n> \n> So I much prefer to say: everything under \".git\" is not versionable, for \n> the fundamental reason that the files under .git are \"global\" to that git \n> repository. \n> \n> And I think .git/grafts in particular makes no sense to version.\n> \n> If you want to track a git \"grafts\" file, you can do it as another git \n> repository and a symlink.\n\nI fully concur with this (as I pointed out in my post, although perhaps \nfuzzily.)\n\n\t-hpa\n"},{"id":"12501","messageId":"Pine.LNX.4.63.0511220136140.6187@wbgn013.biozentrum.uni-wuerzburg.de","threadId":"2639","inReplyTo":"Pine.LNX.4.64.0511211326110.13959@g5.osdl.org","subject":"Re: [RFC] Make grafts versionable","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2005-11-22T00:37:44Z","receivedAt":"2005-11-22T00:37:44Z","isPatch":false,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Mon, 21 Nov 2005, Linus Torvalds wrote:\n\n> In general, making any internal git data versionable is very confusing. So \n> you make the grafts file versionable - that suddenly means that different \n> branches may have different parents for the same commit. And that \n> depending on which branch you have checked out, git-fsck-cache may result \n> in an error, or it may not. That's _nasty_, in my opinion.\n\nYes, that is nasty. It does not reflect my normal usage pattern, but that \ndoes not make it better. So let's forget about that idea of mine.\n\nCiao,\nDscho\n"}]}