{"thread":{"id":"62339","subject":"Feature Proposal: Adding Command for Configuration Diff Between Commits","startedAt":"2024-10-15T10:59:57Z","lastAt":"2024-10-15T16:25:40Z","messageCount":2,"participants":["Prince Roshan","Taylor Blau"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"505135","messageId":"CAP3G6frW_B2pBN0S4H5fsJZgoGtPxC1+_dAzNRhQ9z8ERWZSVg@mail.gmail.com","threadId":"62339","inReplyTo":null,"subject":"Feature Proposal: Adding Command for Configuration Diff Between Commits","fromName":"Prince Roshan","fromEmail":"princekrroshan01@gmail.com","sentAt":"2024-10-15T10:59:44Z","receivedAt":"2024-10-15T10:59:57Z","isPatch":false,"sender":{"key":"princekrroshan01@gmail.com","avatar":null},"body":"Hi Git Community,\n\nI wanted to propose a new feature for Git that I believe would be\nbeneficial for repository maintainers and developers alike. What do\nyou think of adding a command like git config diff commit1 commit2 to\nshow the configuration differences between two commits?\n\nThis command could display differences in repository configurations\n(such as .git/config or submodule configuration) across two specific\ncommits. I see this being particularly useful in scenarios like:\n\nWhen a submodule is added or updated between two commits, helping to\neasily track and compare the submodule's configuration changes.\nIdentifying configuration changes (e.g., repository settings) made\nbetween different commits without having to manually examine each\ncommit’s changes.\nComparing various configuration-related changes in large repositories.\n\nFor example, when managing repositories with submodules, this feature\ncould quickly highlight differences in submodule references, paths, or\nURLs, saving time and providing better traceability.\n\nI believe adding such functionality would enhance Git's usability in\nmanaging complex repository structures and configurations.\n\nLooking forward to hearing your feedback and thoughts on this proposal.\n\nBest regards,\nPrince Roshan\nprincekrroshan01@gmail.com\n"},{"id":"505177","messageId":"Zw6XgpPZBDrq5QuO@nand.local","threadId":"62339","inReplyTo":"CAP3G6frW_B2pBN0S4H5fsJZgoGtPxC1+_dAzNRhQ9z8ERWZSVg@mail.gmail.com","subject":"Re: Feature Proposal: Adding Command for Configuration Diff Between Commits","fromName":"Taylor Blau","fromEmail":"me@ttaylorr.com","sentAt":"2024-10-15T16:25:38Z","receivedAt":"2024-10-15T16:25:40Z","isPatch":false,"sender":{"key":"me@ttaylorr.com","avatar":"https://avatars.githubusercontent.com/u/301000140?v=4"},"body":"On Tue, Oct 15, 2024 at 04:29:44PM +0530, Prince Roshan wrote:\n> Hi Git Community,\n>\n> I wanted to propose a new feature for Git that I believe would be\n> beneficial for repository maintainers and developers alike. What do\n> you think of adding a command like git config diff commit1 commit2 to\n> show the configuration differences between two commits?\n>\n> This command could display differences in repository configurations\n> (such as .git/config or submodule configuration) across two specific\n> commits. I see this being particularly useful in scenarios like:\n\nSubmodule configuration is already diff-able since the state of\nsubmodules is stored in .gitmodules (as you note in your reply to this\nemail further down in this thread).\n\nBut just computing the diff between two commits and focusing on the\n.gitmodules file alone doesn't necessarily have all of the information\nyou're looking for, either. For example, Git's own .gitmodules file has\nthe following contents:\n\n    $ cat .gitmodules\n    [submodule \"sha1collisiondetection\"]\n      path = sha1collisiondetection\n      url = https://github.com/cr-marcstevens/sha1collisiondetection.git\n      branch = master\n\nHere we're using submodule.<url>.branch to specify the branch that we\nwant to check out. So it's impossible to reconstruct the exact SHA-1 we\nchecked out, since it depends on the state of the remote repository as\nwell as our own .gitmodules file.\n\nOn the configuration front, there isn't really a perfect answer either,\nbecause Git configuration is not tracked within the repository. You\ncould consider a workflow where you store the configuration within the\nrepository and then automatically \"install\" that configuration when\nupdating the working copy.\n\nBut that is not without risk, since Git executes arbitrary code based on\ncertain configuration options (e.g., more esoteric options like\ncore.sshCommand and core.alternateRefsCommand, as well as more common\nones like core.editor). So you would have to be careful about when you\ninstall arbitrary configuration, who it is coming from, whether you\ntrust that person, etc.\n\nThanks,\nTaylor\n"}]}