Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create git rule #19

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Create git rule #19

wants to merge 1 commit into from

Conversation

LiuXiangyu
Copy link

@YanagiEiichi @coffeexu @klamtlne 先喷一波。

```
更多介绍可参考[这篇文章](https://robots.thoughtbot.com/git-interactive-rebase-squash-amend-rewriting-history)
### Commit messages
commit信息可以让其他开发者无需阅读代码便快速了解你做了哪些变动。commit信息的主题应该简洁明了,我们希望它包含如下信息:

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

平时开发的时候也可以不断的 git commit -a --amend 保持只有一个commit,但是这样的话,push的时候需要加上-f参数,这样就不需要rebase -i了~

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

开发时保持多个commit还是有必要的,出现bug方便追踪和回退。Commit Often, Perfect Later, Publish Once

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

soga

@gogu
Copy link

gogu commented Dec 8, 2015

这个项目里半角和全角字符中间有空格

`****`:认为此pr会有较大改进空间;

项目的负责者要维护好项目的`Label`,为开发者提供便利。

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

developing:pr依然在开发状态,不要做无谓的review;
need review:开发完毕,希望合作者提出意见;
release:测试通过并且已经安排进最近的发布计划,随时可以发布;
has released:已发布,希望尽快合并;
****:认为此pr会有较大改进空间;已经发布了但因各种原因不能被合到master;

@jiananshi
Copy link

我觉得想覆盖的点太多了,比如 label,也不是所有项目开发方式都这样。适当缩减你的点有助于 pr 合并

@LiuXiangyu
Copy link
Author

@klamtlne 一哥今早让我加的这一块,这一块只是举例,并不是作为规范。

@CarterLi
Copy link
Contributor

CarterLi commented Dec 29, 2015

个人比较反对rebase,rebase会破坏代码提交的时间顺序,而且隐藏掉rebase冲突时的merge操作——因为rebase的merge没有单独的commit,一旦merge出问题难以快速回退,甚至无法知道merge时的代码改动。rebase后还经常出现需要push -f的操作,这与sudo rm -rf一样非常危险。
一个项目并行开发是很正常的现象,代码提交的时间线(timeline)也应该正确反映这一点。rebase只能“假装”串行,实际并未改变并行开发的事实,commit log好看对真实的代码质量实际上毫无关系。片面追求一个PR一次提交个人看来只是舍本逐末。
另外对于是否需要--amend也值得商榷,一次迭代开发本来就分阶段,本来就是一件循序渐进的事情。好的代码往往需要几次较大重构,可能发生在开发过程中,那么这次重构之前的commit就很有必要保留——重构往往就是bug的根源。对于bug修复是否需要amend的问题,如果这次fix真的足够安全,不会引发其他bug,不对别的代码产生任何不良影响,那么这次提交可以amend。然而对于javascript这种多加个换行都可能引起bug的语言来说,真正_安全_的bug修复我估计也只有调整缩进而已

@YanagiEiichi @coffeexu @klamtlne 求喷

EDIT:还有一点,如果出现冲突,pull / merge 只需要把冲突整体解决一遍;而 rebase 有多少 commit 就得解决多少遍


`developing`:pr依然在开发状态;
`need review`:开发完毕,希望合作者提出意见;
`testing`:非常重要,打上这个表情,当使用`make testing`发布到测试环境进行测试时,所以带该标签的pr都会合并在一起进行测试,共用测试环境。

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

表情 -> 标签

每次开始工作前,请确保你的代码是基于合并目标分支(一般是发布分支主分支)的最新代码,因此推荐从该主仓库该分支拉取最新代码新建一个分支:

```
$git fetch origin master:newbranch
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

可以简写为:git fetch origin :newbranch 👻

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

围观。。

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

围观。。

Copy link

@yisibl yisibl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

简写

@YanagiEiichi
Copy link
Contributor

@LiuXiangyu 文档书写参考 https://github.com/ElemeFE/style-guide/blob/master/copywriter.md

中英文之间没空格感觉好难受 😂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants