您通常如何评论 Mercurial 中的合并(独立开发人员,bitbucket 中只有一个外部存储库)?
当我必须提交在 Mercurial 中完成的合并时,我只需执行 hg commit -m "Merge"
合并时您通常会做什么?您是否在注释中编写更改集,或者尝试编写“有意义的”注释(因为我认为它们毫无用处,除非您从不同位置的两个完全不同的存储库进行合并)。
是否可以在 hgrc 的 [alias] 中创建 Mercurial 中的别名(如 hgmerge),它会自动执行 hg commit -m "Merge: Heads ${head}, ${head} ..."
?
When I have to commit merges I've done in mercurial, I just do hg commit -m "Merge."
What do you usually do when Merging? Do you write the changesets in a comment, or try to write "meaningfull" comments (since I think they are useless, except when you're doing merges from two really different repos in different locations).
Is it possible to create an alias in mercurial (like hgmerge) in [alias] in hgrc, that automatically does hg commit -m "Merge: heads ${head}, ${head} ..."
?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
创建该别名很容易(我将在下面进行),但它几乎没有任何价值。从合并变更集中提取parent1和parent2值非常容易,因此它并没有真正告诉您任何比“合并”更多的信息。
就我个人而言,即使在单人存储库中,我也会尝试放置一些至少一半有用的东西,即使它只是这样的东西:
历史记录总是有一些分歧的原因,即使这是一个完全平凡的原因,例如忘记更新或在咖啡店断开连接,这就是我注意到的。
也就是说,您可以这样做:
您应该创建一个 shell 别名:
允许您运行 hg mycommit,但只是挖掘更好的描述。
PS 有人会建议使用
fetch
扩展。忽略他们。It would be easy to create that alias (I'll do it below) but it's also of almost no value. It's very easy to pull the parent1 and parent2 values out of a merge changeset, so it's not really telling you anything more than just "merge" would.
Personally, even on single person repos I try to put something at least halfway useful even if it's just something like these:
There's always some reason history diverged, even if it's a totally mundane reason like forgetting to update or working disconnected at the coffeeshop, and that's what I note.
That said you could do this:
which you sould make a shell alias with:
Allowing you to run
hg mycommit
, but just dig for the better description.P.S. Someone is going to suggest the
fetch
extension. Ignore them.当我在拉取后合并时,我通常只写“拉取后合并”之类的内容。当我必须在合并后纠正某些内容时,我会准确地描述我所做的事情,以便我的同事能够理解这些更改。
当我将一个分支合并到另一个分支时,我精确了提交消息“将branch1合并到branch2”上的两个分支。
至于别名,抱歉,我不知道。
When I'm merging after a pull, I usually only write something like "merge after pull". When I must correct something after the merge, I'll precisely describe what I did so my coworkers can understand the changes.
When I'm merging a branch in another, I precise the two branches on the commit message "merging branch1 in branch2".
As for the alias, sorry, I have no idea.