git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Proposal and Validation of Git Compile

From
BVBhargav Vishnu <bhargavdancer2016@gmail.com>
Date
Mar 13, 2024, 03:24 UTC
Message-ID
<CABCSMAeySCkg6A1R3PUwrHyWRKMKnBH3OGnd8OtX-OpsGoOTkQ@mail.gmail.com>
Hello,

I'm writing to propose and get a validation of one of the ideas I had for git tool. Background: We are currently able to clone the complete repository and access the code. Why don't we allow only part of the code maybe a few lines to be imported into the repository?

Issues:
- Developers have duplicate code within which could be a utility file and
some repositories have whole sets of codes like the Algorithms repository.
We would only require a particular algorithm from that repository, in those
cases, there isn't an easy way to import that snippet.
- A large amount of similar duplicate codes are written by authors in
different personal projects like utilities. These must be made reusable.
Eg: Code on a gist is copied into every repository, why not create and use
the gist itself as it also has versioning?
Idea:
- Specify a syntax which specifies how to import the gist or snippet
- When creating the file use the syntax to import the snippet
- Users need to compile the new file to resolve the snippet but the
decompiled version with the syntax is retained in the cache
- When the user pushes the file use the decompiled version but not the
compiled version so that the git hosted on the server can make references
between repositories and gists
- When another user pulls the decompiled file, the file is compiled as part
of git pull and resolved in the remote reference with the snippet so the
user can run the code.

Issues: Syntax might not be recognized by editors Trust external author's code in production

I have attached the workflow below

I would like to know if there is a better way to solve this issue and avoid code duplication as I have limited knowledge of git.

Thank You

With Regards Bhargav

Next: Reto
Message 1 of 3 in “Proposal and Validation of Git Compile”
  1. Bhargav VishnuMar 13, 2024
  2. RetoMar 13, 2024
  3. Konstantin KhomoutovMar 13, 2024

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.