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

Issue 2: Reference Coupling #2

Open
birdflyi opened this issue Mar 17, 2022 · 3 comments
Open

Issue 2: Reference Coupling #2

birdflyi opened this issue Mar 17, 2022 · 3 comments

Comments

@birdflyi
Copy link
Owner

birdflyi commented Mar 17, 2022

This is an issue.
#1 //项目内引用-相对
#2 //自引用-相对
@w4qed32 //空引-相对
https://github.com/birdflyi/test //项目url
https://github.com/birdflyi/test/issues/new //项目内issue
#1 //项目内引用
#2 //自引用
#1 //项目内引用-完整url
#2 //自引用-完整url
birdflyi/test@w4qed32 //空引
X-lab2017/open-research#2 或者 X-lab2017/open-research@06f8ad9 //他引
^(.)/(.)#[0-9]? //正则:event
^(.
)/(.*)@[0-9a-z]{7} //正则:commit

@birdflyi
Copy link
Owner Author

对照源码:

This is an issue.
#1  //项目内引用-相对
#2  //自引用-相对
@w4qed32  //空引-相对
https://github.com/birdflyi/test  //项目url
https://github.com/birdflyi/test/issues/new  //项目内issue
birdflyi/test#1  //项目内引用
birdflyi/test#2  //自引用
https://github.com/birdflyi/test/issues/1  //项目内引用-完整url
https://github.com/birdflyi/test/issues/2  //自引用-完整url
birdflyi/test@w4qed32  //空引
 X-lab2017/OpenResearch#2 或者 X-lab2017/OpenResearch@06f8ad9  //他引
^(.*)/(.*)#[0-9]*?  //正则:event
^(.*)/(.*)@[0-9a-z]{7}  //正则:commit

@birdflyi
Copy link
Owner Author

birdflyi commented Mar 17, 2022

对比:
#1
birdflyi/test#1
sensu/sensu#449
sensu/sensu#449
sensu/sensu#449 //混乱的引用
源码:

https://github.com/birdflyi/test/issues/1
[birdflyi/test#1](https://github.com/birdflyi/test/issues/1)
https://github.com/sensu/sensu/issues/449
[sensu/sensu#449](https://github.com/sensu/sensu/issues/449)
[sensu/sensu#449](https://github.com/birdflyi/test/issues/1)  //混乱的引用

示例:
sensu/sensu#449 (comment) (此处源码https://github.com/sensu/sensu/issues/449#issuecomment-12612084
image

结论

推荐使用完整url引用(即https://github.com/OWNER/PROJECT/issues/1),避免[OWNER/PROJECT#1](https://github.com/ABC/XYZ/issues/1)混乱引用的问题,避免相对引用#1在级联提交PR后指向更改的问题。

完整url引用:url指向项目内会自动显示为#1的相对引用,url指向项目外会自动显示为OWNER/PROJECT#1;格式详见[1]中Table 1


[1] Blincoe, K., Harrison, F., Kaur, N., & Damian, D. (2019). Reference coupling: An exploration of inter-project technical dependencies and their characteristics within large software ecosystems. Information and Software Technology, 110, 174-189.

@birdflyi
Copy link
Owner Author

分析comment body的时候,#2或者@06f8ad9 (共7位sha码)都是可能的形式,较容易和@人名混。按引用格式正则匹配的字符串需要清洗。

@birdflyi birdflyi changed the title Issue 2 Issue 2: Reference Coupling Mar 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant