Keeping track of source code variants

后端 未结 6 1817
眼角桃花
眼角桃花 2021-02-06 02:03

I am soon starting to maintain a line of products containing variants of the same embedded software. Since I\'ve been playing with git for one year and appreciate it very much,

6条回答
  •  刺人心
    刺人心 (楼主)
    2021-02-06 02:34

    I'm facing the same issue. I want to share source not just among targets, but across platforms (e.g Mono vs. Visual studio. It seems like there isn't any wway to easily do that with just the version the branching/tagging provide by Git. Because ideally, you'd like to maintain a common code branch, and host/target specific branches and just merge the common code in and out of those branches. But I don't know how to do that. Maybe a combination of branching and tagging? Anybody?

    Obviously, I would use condition compilation if it was needed where I could, so that there would only be one source file under version control, but for the other stuff files that should only appear in one host/target branch, or where the contents would be completely different, a different mechanism is needed. If you can use OO techniques to side step the problem that too would be desirable.

    So the answer seems to be you need some sort of configuration/build management mechanism on top of git to manage this. But that would seem to add a lot of complexity, so maybe cherry picking merges into a common branch wouldn't be a bad way to go. Especially if you use other techniques to keep the source variants to a minimum. (Could tagging help automate this?).

提交回复
热议问题