{"thread":{"id":"61107","subject":"Proposal and Validation of Git Compile","startedAt":"2024-03-13T03:24:30Z","lastAt":"2024-03-13T09:59:33Z","messageCount":3,"participants":["Bhargav Vishnu","Reto","Konstantin Khomoutov"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"490527","messageId":"CABCSMAeySCkg6A1R3PUwrHyWRKMKnBH3OGnd8OtX-OpsGoOTkQ@mail.gmail.com","threadId":"61107","inReplyTo":null,"subject":"Proposal and Validation of Git Compile","fromName":"Bhargav Vishnu","fromEmail":"bhargavdancer2016@gmail.com","sentAt":"2024-03-13T03:24:17Z","receivedAt":"2024-03-13T03:24:30Z","isPatch":false,"sender":{"key":"bhargavdancer2016@gmail.com","avatar":null},"body":"Hello,\n\nI'm writing to propose and get a validation of one of the ideas I had for\ngit tool.\nBackground:\nWe are currently able to clone the complete repository and access the code.\nWhy don't we allow only part of the code maybe a few lines to be imported\ninto the repository?\n\nIssues:\n- Developers have duplicate code within which could be a utility file and\nsome repositories have whole sets of codes like the Algorithms repository.\nWe would only require a particular algorithm from that repository, in those\ncases, there isn't an easy way to import that snippet.\n- A large amount of similar duplicate codes are written by authors in\ndifferent personal projects like utilities. These must be made reusable.\nEg: Code on a gist is copied into every repository, why not create and use\nthe gist itself as it also has versioning?\n\nIdea:\n- Specify a syntax which specifies how to import the gist or snippet\n- When creating the file use the syntax to import the snippet\n- Users need to compile the new file to resolve the snippet but the\ndecompiled version with the syntax is retained in the cache\n- When the user pushes the file use the decompiled version but not the\ncompiled version so that the git hosted on the server can make references\nbetween repositories and gists\n- When another user pulls the decompiled file, the file is compiled as part\nof git pull and resolved in the remote reference with the snippet so the\nuser can run the code.\n\n\nIssues:\nSyntax might not be recognized by editors\nTrust external author's code in production\n\nI have attached the workflow below\n\nI would like to know if there is a better way to solve this issue and avoid\ncode duplication as I have limited knowledge of git.\n\nThank You\n\nWith Regards\nBhargav\n"},{"id":"490532","messageId":"52ot6dibj4o5mhgsmxpa5r2hkllxrwwhf2azgkvtpaopldi2pg@5etkc4r3eunm","threadId":"61107","inReplyTo":"CABCSMAeySCkg6A1R3PUwrHyWRKMKnBH3OGnd8OtX-OpsGoOTkQ@mail.gmail.com","subject":"Re: Proposal and Validation of Git Compile","fromName":"Reto","fromEmail":"reto@labrat.space","sentAt":"2024-03-13T08:08:26Z","receivedAt":"2024-03-13T08:14:04Z","isPatch":false,"sender":{"key":"reto@labrat.space","avatar":null},"body":"On Tue, Mar 12, 2024 at 11:24:17PM -0400, Bhargav Vishnu wrote:\n> - A large amount of similar duplicate codes are written by authors in\n> different personal projects like utilities. These must be made reusable.\n> Eg: Code on a gist is copied into every repository, why not create and use\n> the gist itself as it also has versioning?\n\nYou are re-inventing the normal dependency packaging of the languages, poorly.\nWe already have language specific ways (npm, pip, cargo, go get...) for almost\nall ecosystems. They have version controlled and checksumed dependency resolution\nand are actually aware what's needed (binary vs source distribution, additional\ndeps etc).\n\nI don't see why you'd want your version control system to do it, rather than\nusing what already exists.\n\n\"Code on a gist is copied into every repository\" is what we call a library, so\npackage it up and pull it down with your favorite dependency management tool\nduring the project build.\n"},{"id":"490535","messageId":"20240313095916.ydcnyzhdmc6jbfms@carbon","threadId":"61107","inReplyTo":"CABCSMAeySCkg6A1R3PUwrHyWRKMKnBH3OGnd8OtX-OpsGoOTkQ@mail.gmail.com","subject":"Re: Proposal and Validation of Git Compile","fromName":"Konstantin Khomoutov","fromEmail":"kostix@bswap.ru","sentAt":"2024-03-13T09:59:16Z","receivedAt":"2024-03-13T09:59:33Z","isPatch":false,"sender":{"key":"kostix@bswap.ru","avatar":null},"body":"On Tue, Mar 12, 2024 at 11:24:17PM -0400, Bhargav Vishnu wrote:\n\n> I'm writing to propose and get a validation of one of the ideas I had for\n> git tool.\n[...]\n> Eg: Code on a gist is copied into every repository, why not create and use\n> the gist itself as it also has versioning?\n[...]\n\nIn addition to what Reto said in their respective answer, you seem to confuse\nGit (a version control tool) and Github - a turn-key Git hosting solution.\nThe thing is, the concept of \"gists\" does not exist in Git, and also it does\nnot have any real concept of a repository fork, a pull request, issue tracking\nand so on.\nThat is, to build what you propose on your workflow picture, you'd need to\nimplement it in Github, not Git.\n\nThat said, I support what Reto said: Gists are merely pastebins [1] of the\n21th century, and I think you perceive them as version-controlled code because\nyou supposedly are a relatively young person ;-) For an old fart like me,\nGists are just a sort of convenient way to share snippets of code with someone\nelse (say, when you're chatting on StackOverflow or elsewhere and would like\nto show to your peer a bit more than a one-liner).\n\nAnd if we think about making reusable pieces of code, this is ineed a solved\nproblem: libraries, packages and package repositories.\nNot that I do not find your idea having a particular appeal - it does, - just\nit's not in the domain of Git itself. A packaging system could possibly\nsomehow intergate with Gists (but note that that could only really sensibly\nwork for interpreted languages such as JS, which you seem to think of anyway),\nbut that's a task for that package system, not Git. For instance, Go's package\nmanagement system allows storage of the packages (in the form of the source\ncode) using multiple VC systems - namely, Git, Mercurial, Fossil and\nSubversion, and it's semi-transparent to the users. Note that implementing\nthis package system did not require any support from the mentioned VC systems.\nQuite possibly, say, NPM, could be made to work with Gists in the way you\nenvision, but it's to be discussed with NPM folks, not Git folks.\n\n 1. https://en.wikipedia.org/wiki/Pastebin\n\n"}]}