{"thread":{"id":"51043","subject":".git/config validations by (for silly errors) by git fsck","startedAt":"2019-05-06T18:32:18Z","lastAt":"2019-05-06T23:31:15Z","messageCount":2,"participants":["Palauzov, Dilyan","Ævar Arnfjörð Bjarmason"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"374951","messageId":"36d37bdd70fba719ecee2c5572a8b85bc9940944.camel@sit-extern.fraunhofer.de","threadId":"51043","inReplyTo":null,"subject":".git/config validations by (for silly errors) by git fsck","fromName":"Palauzov, Dilyan","fromEmail":"dilyan.palauzov@sit-extern.fraunhofer.de","sentAt":"2019-05-06T18:19:17Z","receivedAt":"2019-05-06T18:32:18Z","isPatch":false,"sender":{"key":"dilyan.palauzov@sit-extern.fraunhofer.de","avatar":null},"body":"Hello,\n\nI added manually a remote to .git/config, but updated only the url= line, forgetting to update the fetch= line.  So two\nremotes had\n  fetch = +refs/heads/*:refs/remotes/origin/*\n\nand fetching from the one or the other has overwritten origin/master.  git fsck has not helped.\n\nPlease introduce a check in git fcsk that triggers, when two different remotes share the same fetch line, or if the\nfetch line does not reference the remote name.\n\nRegards\n  Дилян\n"},{"id":"374967","messageId":"875zqni2ip.fsf@evledraar.gmail.com","threadId":"51043","inReplyTo":"36d37bdd70fba719ecee2c5572a8b85bc9940944.camel@sit-extern.fraunhofer.de","subject":"Re: .git/config validations by (for silly errors) by git fsck","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2019-05-06T23:31:10Z","receivedAt":"2019-05-06T23:31:15Z","isPatch":false,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"\nOn Mon, May 06 2019, Palauzov, Dilyan wrote:\n\n> I added manually a remote to .git/config, but updated only the url= line, forgetting to update the fetch= line.  So two\n> remotes had\n>   fetch = +refs/heads/*:refs/remotes/origin/*\n>\n> and fetching from the one or the other has overwritten origin/master.  git fsck has not helped.\n>\n> Please introduce a check in git fcsk that triggers, when two different remotes share the same fetch line, or if the\n> fetch line does not reference the remote name.\n\nPehaps we need a 0bc8d71b99 (\"fetch: stop clobbering existing tags\nwithout --force\", 2018-08-31) but for remote branches :)\n\nThere could be room for something like this in some config-lint tool,\nbut what you're suggesting is not an error in the general case. There's\nmany use-cases for having remotes with overlapping or identical fetch\nrefspecs, e.g. maybe you fetch the \"same\" repo from two different URLs,\nor one is a superset of the other (and can clobber the subset).\n\nWhen you remove a remote there's even a check for this, we discover if\nthe refspecs exclusively \"belong\" to it (and then remove the remote\ntracking branches), not if other remotes overlap.\n\nWhether such a check would be viable would be one thing, but it wouldn't\ncurrently belong in git-fsck, its job is to check the object database\nfor sanity, but perhaps there's cases where it makes sense to expand\nthat (e.g. shallow/narrow clones where you want a \"full\" check).\n"}]}