40

標準レイアウト、つまりトランク/とブランチ/(およびタグ/)のSubversionリポジトリがあります。より大きな変更に取り組んでいるときは、機能ブランチが使用され、定期的にトランクと同期され、後でトランクに再統合されます (現在は 1.5 を使用)。かなり標準的なもの。

私が疑問に思っているのは、そのような機能ブランチが完成してマージされたら、そのままにしておくべきか、削除するべきかということです。Subversion book では、ブランチを削除するのが一般的であると示唆しているように見えることがありますが、ブランチを保持しているオープン ソース プロジェクトも数多く見てきました。

また、ブランチを削除するとどのブランチが存在したかを追跡するのがどのように難しくなるかについても少し心配です。特に、重複する可能性のある名前がシナリオに入った場合 (たとえば、2 回検索リファクタリングした場合)、それらのコミット履歴がリポジトリの深さのどこかで消えてしまいます。等

一方、ブランチは非常に頻繁に使用されており、特に現在の 1.5 では、現在取り組んでいるブランチを見つけるために非アクティブなブランチの膨大なリストを調べなくて済むという考えが気に入っています。

私が見逃している長所と短所は何ですか? 人々は何をしていますか?

4

4 に答える 4

28

If you are really worried about deleting them, lest they be forgotten, then simply create a folder under branches called 'inactive' and svn move your older, inactive branches into that folder. This might be the best of both worlds for you.

于 2008-10-02T14:34:51.713 に答える
23

You can safely delete them. Deleting them doesn't remove them from the repository, the allocated space is never reclaimed, but it sure makes your whole project tree look more cleaned up.

于 2008-10-02T14:31:03.033 に答える
11

I've been deleting feature branches as we're done, as I like the lack of clutter. There has been minor confusion on the part of some other developers, but since we record revision numbers of commits in our bug-tracking system, it's been pretty smooth. If someone comes by saying they can't find a branch, advice to use the -rrevision flag on their log/diff/checkout/whatever is generally all that's needed.

于 2008-10-02T14:33:58.207 に答える
8

My team deletes them to keep the clutter down. It's not like the go away after all; they can be retrieved if desired. You are right that it can be difficult to find them again: you need to know a revision number where the branch existed so you tell your client to look at that revision in order to see your files.

We use FogBugz for our project management which keeps track of when things were committed to our SVN repository by revision number. We can use this to determine what revision we need to revert to in order to see our files: we find the feature history in FogBugz, look to determine what revisions the branch existed in, and use that information to jump backwards.

于 2008-10-02T14:34:22.887 に答える