蒋鑫:从Git社区看配置管理.pdf_第1页
蒋鑫:从Git社区看配置管理.pdf_第2页
蒋鑫:从Git社区看配置管理.pdf_第3页
蒋鑫:从Git社区看配置管理.pdf_第4页
蒋鑫:从Git社区看配置管理.pdf_第5页
已阅读5页,还剩47页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

从git社区看git 群英汇蒋鑫 2012/7/19 从我用商业软件制作ppt 开始说起. 2 git 像微博? 3 传统网络媒体 / svn微博 / git 小而固定的编辑群体人人都是微媒体 集中式的发布流程基于信任(加粉)的发布和传播 封站、单点故障“禁言”不影响转发 读者参与欲望低生活的一部分、full of fun 新一代分布式版本控制系统 4 服务器 dvcs 终端 终端 终端 share repo “普通青年”如何使用git ooo oooooo cloneclone oooooo “普通青年”如何使用git ooo ooo share repo commit commit ooo oo oooo “普通青年”如何使用git ooo ooo share repo ooo x 修补提交 ? 压缩提交 oo oooo “普通青年”如何使用git ooo ooo share repo ooo ooo ooo “普通青年”如何使用git ooo ooo ooo ooooo share repo push(fast-forward push) “普通青年”如何使用git ooo ooo ooo ooo ooooo 非快进式(non-fast-forward) push share repo “普通青年”如何使用git ooo ooo ooo ooo ooo fetch share repo ooooo “普通青年”如何使用git ooo ooo ooo ooo ooooo ooo share repo merge ooo ooo oo o “普通青年”如何使用git ooo ooo ooooo o ooo share repo push dag ooooo o ooo ooo ooo “普通青年”如何使用git ooooo o ooo ooooo o ooo share repo pull “普通青年”如何使用git 15 clonecommitcommit push fast- forward? pull conflict? mergetool push 是 是 否 否 add add rm mv 使用git,项目规模可以提高 一个数量级! 16 svn的小而固定的“编辑群” 寻找一个使用svn的开源项目并不容易了 ;-) apache subversion(根据提交说明统计) 1 3902 karl fogel 2 3728 hyrum kurt wright 3 3440 c. michael pilato 4 2422 julian foad 5 2354 bert huiben . 176 1 arwin arni 17 管理负担导致“小而固定编辑群” 提交者越多版本库管理越复杂 统一认证和授权管理 贡献者苦恼 无法版本控制 贡献间接署名 18 git 的署名作者有多少? 针对 git v1.7.11 的统计 $ git log -pretty=“%an“ v1.7.11 | sort | uniq -c | sort -rn | less -n 1 10904 junio c hamano 2 1328 shawn o. pearce 3 1103 linus torvalds 4 855 jeff king 5 729 johannes schindelin . 1028 1 aaron crane 19 git中贡献皆署名 $ git log -1 -pretty=fuller v1.7.1134 commit f50b565a0f3af5a4045d0e713ac43e3f0de3aa9a author: jiang xin authordate: thu may 31 19:20:42 2012 +0800 commit: junio c hamano commitdate: fri jun 1 07:43:10 2012 -0700 i18n: apply: split to fix a partial i18n message the 4th arg of “new mode (%o) of %s does not match old mode (%o)%s%s“ is blank string or string “ of “. even mark the string “ of “ for a complete i18n, this message is still hard to translate right. split it into two slight different messages would make l10n teams happy. signed-off-by: jiang xin signed-off-by: junio c hamano 20 “文青”使用git 人人皆可hack 克隆或更新 未克隆? $ git clone git://pub/scm/git/git.git $ cd git 已克隆? $ cd git $ git pull 创建本地分支 myhack $ git checkout -b myhack master hack. 提交(带 s-o-b 签名) $ git commit -s 21 只读 “文青”使用git 查看 myhack 分支提交:git show -stat -pretty=fuller head commit e0a47e9dfee5278bad948c91f7707ac766d99d7d author: jiang xin authordate: thu may 31 19:20:42 2012 +0800 commit: jiang xin commitdate: thu may 31 19:29:28 2012 +0800 i18n: apply: split to fix a partial i18n message the 4th arg of “new mode (%o) of %s does not match old mode (%o)%s%s“ is blank string or string “ of “. even mark the string “ of “ for a complete i18n, this message is still hard to translate right. split it into two slight different messages would make l10n teams happy. signed-off-by: jiang xin builtin/apply.c | 16 +- 1 个文件被修改,插入 12 行(+),删除 4 行(-) 22 时间戳不同? git commit -amend “文青”使用git 创建补丁 $ language=c git format-patch -no-thread -no-cover-letter headhead 0001-i18n-apply-split-to-fix-a-partial-i18n-message.patch 查看补丁 $ head -6 0001-i18n-apply-split-*.patch from e0a47e9dfee5278bad948c91f7707ac766d99d7d mon sep 17 00:00:00 2001 from: jiang xin date: thu, 31 may 2012 19:20:42 +0800 subject: patch i18n: apply: split to fix a partial i18n message the 4th arg of “new mode (%o) of %s does not match old mode (%o)%s%s“ 23 “文青”使用git 通过邮件发送补丁 $ git send-email -to “junio c hamano “ -cc “git list “ -cc “var arnfjr bjarmason “ -cc “nguyn thi ngc duy “ -cc “jonathan nieder “ 0001-i18n-apply-split-to-fix-a-partial-i18n-message.patch 邮件相关设置 $ git config -l | grep sendemail sendemail.chainreplyto=true sendemail.smtpencryption=ssl sendemail.smtpserver= sendemail.smtpuser= 24 “文青”使用git 通过邮件列表评审 25 “文青”使用git junio应用贡献者的补丁: git am -s file. 官方库中的提交: git log -1-pretty=fuller head commit f50b565a0f3af5a4045d0e713ac43e3f0de3aa9a author: jiang xin authordate: thu may 31 19:20:42 2012 +0800 commit: junio c hamano commitdate: fri jun 1 07:43:10 2012 -0700 i18n: apply: split to fix a partial i18n message the 4th arg of “new mode (%o) of %s does not match old mode (%o)%s%s“ is blank string or string “ of “. even mark the string “ of “ for a complete i18n, this message is still hard to translate right. split it into two slight different messages would make l10n teams happy. signed-off-by: jiang xin signed-off-by: junio c hamano 1 http:/git-blame.blogspot.jp/p/note-from-maintainer.html 梯子自备 其他参考 1 integration managers 子项目的合并 32 git合并的子项目 gitk git-gui gitweb(不再独立更新) git-subtree(不再独立更新) 项目目录结构重叠,要作为子树合并 git subtree add -p subdir alien-branch git merge -xsubtree=subdir alien-branch 逐级的pull request 和 pull 33 clone commitcommit push -u xx master fetch xx push remote add xx url request-pull merge -ff-only xx/master conflict? merge -abort fetch origin merge rebase remote add xx url 是 否 pull requests 34 git本地化工作流 35 工作流原则 没人了解所有自然语言:每个语种一个负责人 有人要分担junio工作:一个“l10n协调者” 本地化贡献者无需精通git: 不需要补丁模式 无需自建git服务器 无需命令行操作创建给“l10n协调者”的pull request github github简化了如下的流程 36 clone commitcommit push -u xx master fetch xx push remote add xx url request-pull merge -no-ff xx/master conflict? merge -abort fetch origin merge rebase remote add xx url 是 否 fork pull request merge git-l10n/git-po 37 本地化中的git操作 38 zh_cn l10n team: commit vi po/zh_cn.po $ git commit -s $ git push zh_cn l10n team: github pull request l10n coordinator: pull $ git clone ssh://git-l10n/git-po.git $ cd git-po $ git remote add zh-cn git://gotgit/git-po_zh-cn.git $ git fetch zh-cn $ git merge zh-cn/master l10n coordinator: check, push & pull request $ po-helper.sh check $ git push $ git request-pull . github pull request 39 不能改动 po/ 目录之外的文件 xx.po 文件的语法检查 提交说明格式:遵循50/72原则、s-o-b 提交说明字符集:可用utf-8,但第一行要全英文 占位式提交用分支暂存:wip/xx/master 辅助工具:po-helper.sh /git-l10n/git-po/blob/po-helper/po/po-helper.sh l10n协调者对pull request的审核 40 创建给junio的pull request 41 命令 $ git request-pull junio/master git://git-l10n/git-po master 输出 pull request 文本 the following changes since commit 726016725d45894c061e8d187385327f82803c9f: sync with i18n-po updates in maint (2012-07-02 15:37:54 -0700) are available in the git repository at: git://git-l10n/git-po for you to fetch changes up to 6792b93b1965561e85be3733bb3ab00b2e598119: l10n: zh_cn.po: translate 29 new messages (2012-07-06 09:11:15 +0800) . pull request发送至git列表 42 git工作流汇总 43 集中式(beginner & business) 未见有开源社区使用此模式 补丁式:format-patch, mailing list & am 绝大多数 git 贡献者 通过邮件列表,全员参与的代码审核 子树合并 git-gui, gitk, . 逐级的pull request & pull 例如 junio 和 integration managers 之间 github pull request l10n coordinator 和 l10n team leaders 之间 linus 不喜欢 github pull request /torvalds/linux/pull/17#issuecomment-5654674 git分支管理四个整合分支 git.git 的四个整合分支 maint : 当前最新发布版本/维护版本 最新提交一定对应一个tag:v1.7.11, v, v master : 下一个发布版本 git describe 结果: v-194-g7bdb7 v1.7.12-rc0 next : 主题分支并入master分之前的测试 pu : proposed updates 参考 $ git help workflows 44 git分支管理merge的学问 基于最老的支持版本做bugfix 合并方向: maint-1.6.x maint master 维护版本发布 git tag -s v maint git log mastermaint git checkout master git merge maint git push git push -tags 新版本发布 git tag -s v1.7.12 master git checkout maint git merge

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论