4 ms·
I'm actually surprised you can't stage regions in magit, as it clearly seems to indicate that you can. Mark a section and it will ask about regions. Clearly,
by taeric 3y ago
I'm actually surprised you can't stage regions in magit, as it clearly seems to indicate that you can. Mark a section and it will ask about regions. Clearly, this hasn't come up that often for me, or I may have already known this. (More likely, if it came up often, someone would have made it work. :D )
I do think regarding things as "text" goes a long way to underestimating what can be done with it. As easy to think of it as serialized symbols, where the symbols can have specific meaning. At this point, the power seems a bit more manifest. If you are lucky (and someone else has put in the work), then you can use familiar "textual" symbol manipulations and that will keep meaning in the other domain that is being represented.
- omnicognate 3y agoYou certainly can stage regions. The author is complaining of a bug - not one I've seen and possibly some sort of interaction with another package he's using. Magit's author is awesome so maybe worth raising a github issue... and donating!
- taeric 3y agoMy try a minute ago made it seem that it will stage every line in the region you make. Subline regions don't come up that often. Or did I try something wrong?
- omnicognate 3y agoYeah, it works at the line level (as indicated by the way it highlights the selected lines) which I think is a limitation as much of git itself as magit. (I'm not sure what subline staging would even do.) But the author isn't trying to stage a region, let alone a subline one. He's trying to stage a whole hunk and says its only working if point is at the start of the line.
- taeric 3y agoMakes sense. I definitely took the complaint to mean that it only works at the line level. Probably because that was the only way I could see the behavior not working? Subline staging makes sense for some changes. In that, if it does subline indications of what changed, I would expect I could accept one of the changes, but not the others. That said, I agree it is likely a limitation of git, as much as of magit. And, again, I can't imagine this comes up that often.