Difference between revisions of "Talk:Working with Git"

From Inkscape Wiki
Jump to navigation Jump to search
(→‎TODO list after the GitLab Migration: release branches are renamed)
(→‎TODO list after the GitLab Migration: two more done (some might still be worth looking into, especially policy-wise))
 
(11 intermediate revisions by 3 users not shown)
Line 3: Line 3:
(feel free to modify and expand, [[User:Eduard|Eduard]] ([[User talk:Eduard|talk]]))
(feel free to modify and expand, [[User:Eduard|Eduard]] ([[User talk:Eduard|talk]]))


* Update build for git [Mc?]<br/>code compiles fine already but in some places we depended on bzr (notably for getting revno)
* <s>Update build for git</s> ([https://gitlab.com/inkscape/inkscape/commit/7811297f0ad86acaad0477096dd919f51e18b3e7 done]) [Mc]<br/><s>code compiles fine already but in some places we depended on bzr (notably for getting revno)</s>
* Clean-up branches
* Clean-up branches
** Make all (release) branches protected branches to prevent accidental force-pushes and other potentially destructive actions (equivalent to bzr append-only branches)
** <s>Make all (release) branches protected branches to prevent accidental force-pushes and other potentially destructive actions (equivalent to bzr append-only branches)</s> (done)
*** If no further commits are supposed to happen to them, they could be marked as 'protected' via gitlab interface (which allows you to set very fine-grained merge and push permissions).
*** If no further commits are supposed to happen to them, they could be marked as 'protected' via gitlab interface (which allows you to set very fine-grained merge and push permissions).
** Rename branches (we have ~100 branches imported and it's impossible to find anything). Suggestion:
** Rename branches (we have ~100 branches imported and it's impossible to find anything). Suggestion:
*** <s>Release branches (''inkscape.dev_RELEASE_0_91_BRANCH'', ''inkscape.board_0.92.x'', etc.) are renamed to plain ''0.91.x'', ''0.92.x'', etc. This will automatically put them at the top of the branch list and should make searching for them easy.</s> (done by Eduard)
*** <s>Release branches (''inkscape.dev_RELEASE_0_91_BRANCH'', ''inkscape.board_0.92.x'', etc.) are renamed to plain ''0.91.x'', ''0.92.x'', etc. This will automatically put them at the top of the branch list and should make searching for them easy.</s> (done) [Eduard]
*** Other branches: Keep for now; see next bullet point
*** Other branches: Keep for now; see next bullet point
** Sort through other branches that are not release branches
** Sort through other branches that are not release branches
*** Delete branches that are not needed anymore. (For example I realized branches of rejected merge requests were exported, too; I assume it's fine to get rid of them?)
*** Delete branches that are not needed anymore. (For example I realized branches of rejected merge requests were exported, too; I assume it's fine to get rid of them?)
*** In the long run: Decide whether to move those branches to another repo for safekeeping. I suggest we aim at only having release branches under [https://gitlab.com/inkscape/inkscape inkscape/inkscape] while feature branches of developers should reside in personal forks
*** In the long run: Decide whether to move those branches to another repo for safekeeping. I suggest we aim at only having release branches under [https://gitlab.com/inkscape/inkscape inkscape/inkscape] while feature branches of developers should reside in personal forks
*** [https://gitlab.com/inkscape/inkscape/tree/inkscape.dev_credentials inkscape.dev_credentials] should probably be moved to a separate repository
*** <s>[https://gitlab.com/inkscape/inkscape/tree/inkscape.dev_credentials inkscape.dev_credentials] should probably be moved to a separate repository</s> ([https://gitlab.com/inkscape/inkscape-infra/credentials/ done])
* Re-add tags for past releases (some were lost during the migration)
* Re-add tags for past releases (some were lost during the migration)
* Set up continuous integration. There are already many devs excited to get CI up and running for different platforms! This will ensure to maintain a certain code quality down the line and prevent build breakages going unnoticed.
* <s>Set up continuous integration. There are already many devs excited to get CI up and running for different platforms! This will ensure to maintain a certain code quality down the line and prevent build breakages going unnoticed.</s>
** Linux:
** <s>Linux: CI via GitLabCI</s> ([https://gitlab.com/inkscape/inkscape/commit/7bc2bea2ca29dca36a7768a2b040f6823efd0c2f done]) [tedg, Mc]
** macOS: [tghs]
** <s>macOS: CI via GitLabCI with runner hosted on VM</s> (done: [https://gitlab.com/inkscape/inkscape/commit/ba8c21889ef78e7672444127b99cc04c129be37c 1] [https://gitlab.com/inkscape/inkscape/commit/6984b49a745784627f3b1ee3bb3c1b1513b37e77 2]) [tghs]
** Windows: CI via Appveyor and MSYS2 [https://gitlab.com/inkscape/inkscape/commit/cfaf5b49cacd65bcba8e9b3057f3b202ef3b9343 prepared] [Eduard], needs authorization by GitLab user with "owner" permissions.
** <s>Windows: CI via Appveyor and MSYS2</s> ([https://gitlab.com/inkscape/inkscape/commit/cfaf5b49cacd65bcba8e9b3057f3b202ef3b9343 done]) [Eduard]
* Decide on how we want to handle commit and repo access in the future.<br>GitLab has much to offer to optimize what we did on Launchpad to make contributions easier while still making sure commits will not break badly. Some random thoughts that cam up already:
* Decide on how we want to handle commit and repo access in the future.<br>GitLab has much to offer to optimize what we did on Launchpad to make contributions easier while still making sure commits will not break badly. Some random thoughts that cam up already:
** Should we enforce merge requests for all larger changes in future? These can be automatically checked via CI to prevent ever getting broken code into the master branch. If enough people are around we might even think about proper code review at some point.
** Should we enforce merge requests for all larger changes in future? These can be automatically checked via CI to prevent ever getting broken code into the master branch. If enough people are around we might even think about proper code review at some point.
Line 25: Line 25:
* Finalize set-up of GitLab repo
* Finalize set-up of GitLab repo
** The previous bullet point will decide some settings regarding repo access
** The previous bullet point will decide some settings regarding repo access
** <s>Shall we enforce "fast-forward merges"? (i.e. all merges will always be rebased on top of the master branch before merging making the merge commit "Merge branch some_feature ..." unnecessary)</s> (enabled by Bryce)
** <s>Shall we enforce "fast-forward merges"? (i.e. all merges will always be rebased on top of the master branch before merging making the merge commit "Merge branch some_feature ..." unnecessary)</s> (enabled by Bryce)<br>Should be reverted as the "[https://docs.gitlab.com/ee/workflow/rebase_before_merge.html Rebase button]" is only shown for people having write permissions on the branch to be merged (i.e. typically only the requester) making it impossible to merge most MEs via web UI.
** <s>PRs are non-public right now</s> (seems already fixed)
** <s>PRs are non-public right now</s> (seems already fixed)
** Consider moving inkscape-docs repo, board repo, windows devlibs repos etc. (and if done, remember to adapt website and wiki accordingly)
** Consider moving inkscape-docs repo, board repo, windows devlibs repos etc. (and if done, remember to adapt website and wiki accordingly)
Line 31: Line 31:
** Perhaps send out invitations to devs who have not registered yet? This can be done from the 'members' tab of the 'Settings' page by project masters and owners.
** Perhaps send out invitations to devs who have not registered yet? This can be done from the 'members' tab of the 'Settings' page by project masters and owners.
** Double-check permissions. Decide on whether Inkscape devs should be given developer status for all Inkscape subgroups, or only on their own subgroup.
** Double-check permissions. Decide on whether Inkscape devs should be given developer status for all Inkscape subgroups, or only on their own subgroup.
== Questions/Confusions ==
* How does one get a list of branches?<br/>'''Answer:''' <code>git branch</code> lists local branches, <code>git branch -r</code> lists all branches (local and from all remotes).
* How can one have a set of parallel branches: trunk, 0.92.x, 0.91.x ...?<br/>'''Answer:''' See frontpage, [[Working with Git#Checkout multiple branches into different folders]]
* Should it be 'origin/0.92.x' rather than '0.92.x'?<br/>'''Answer:''' 'origin/0.92.x' references the branch '0.92.x' in the remote called 'origin' (typically this is the repository that you initially cloned). The locally checked out branch is referred to by plain '0.92.x'. You can other remotes (e.g. 'upstream') and reference those as 'upstream/0.92.x'
== Get full commit history ==
''(probably needs to be placed somewhere else eventually, [[User:Eduard|Eduard]] ([[User talk:Eduard|talk]]) 03:11, 12 June 2017 (UTC))''
I just found out, that our git import has the full history back to 2003-10-30 (it's in 0.45.x/0.46.x branches) while trunk only reaches back to 2006-01-16 (we're missing 8691 revisions in total).
  179fa413b047bede6e32109e2ce82437c5fb8d34  -->  first commit in trunk/master
  971d8ce896dc59d3ec6430610d6ae28586c1301f  -->  the same commit in 0.45.x/0.46.x (but has no relationship with trunk/master)
  9ed8de136577ccaaae3289dd4165171573c7bcbc  -->  initial commit in 0.45.x/0.46.x
Nice thing about git: We can stitch together both histories using [https://git-scm.com/docs/git-replace git-replace]!
A simple
  git replace 179fa413b047bede6e32109e2ce82437c5fb8d34 971d8ce896dc59d3ec6430610d6ae28586c1301f
will tell git that it should replace the first commit in trunk/master with the same commit in 0.45.x/0.46.x.
As a result all revisions descending from 179fa413b047bede6e32109e2ce82437c5fb8d34 will now have proper ancestry reaching back to 9ed8de136577ccaaae3289dd4165171573c7bcbc.

Latest revision as of 19:35, 15 January 2018

TODO list after the GitLab Migration

(feel free to modify and expand, Eduard (talk))

  • Update build for git (done) [Mc]
    code compiles fine already but in some places we depended on bzr (notably for getting revno)
  • Clean-up branches
    • Make all (release) branches protected branches to prevent accidental force-pushes and other potentially destructive actions (equivalent to bzr append-only branches) (done)
      • If no further commits are supposed to happen to them, they could be marked as 'protected' via gitlab interface (which allows you to set very fine-grained merge and push permissions).
    • Rename branches (we have ~100 branches imported and it's impossible to find anything). Suggestion:
      • Release branches (inkscape.dev_RELEASE_0_91_BRANCH, inkscape.board_0.92.x, etc.) are renamed to plain 0.91.x, 0.92.x, etc. This will automatically put them at the top of the branch list and should make searching for them easy. (done) [Eduard]
      • Other branches: Keep for now; see next bullet point
    • Sort through other branches that are not release branches
      • Delete branches that are not needed anymore. (For example I realized branches of rejected merge requests were exported, too; I assume it's fine to get rid of them?)
      • In the long run: Decide whether to move those branches to another repo for safekeeping. I suggest we aim at only having release branches under inkscape/inkscape while feature branches of developers should reside in personal forks
      • inkscape.dev_credentials should probably be moved to a separate repository (done)
  • Re-add tags for past releases (some were lost during the migration)
  • Set up continuous integration. There are already many devs excited to get CI up and running for different platforms! This will ensure to maintain a certain code quality down the line and prevent build breakages going unnoticed.
    • Linux: CI via GitLabCI (done) [tedg, Mc]
    • macOS: CI via GitLabCI with runner hosted on VM (done: 1 2) [tghs]
    • Windows: CI via Appveyor and MSYS2 (done) [Eduard]
  • Decide on how we want to handle commit and repo access in the future.
    GitLab has much to offer to optimize what we did on Launchpad to make contributions easier while still making sure commits will not break badly. Some random thoughts that cam up already:
    • Should we enforce merge requests for all larger changes in future? These can be automatically checked via CI to prevent ever getting broken code into the master branch. If enough people are around we might even think about proper code review at some point.
    • Should we allow direct push access to the main repo or take the above a step further and require MRs for everything?
    • Who should be able to merge MRs? All developers or a group of select trusted devs? (review might create a bottleneck, so has to be carefully considered)
  • Finalize set-up of GitLab repo
    • The previous bullet point will decide some settings regarding repo access
    • Shall we enforce "fast-forward merges"? (i.e. all merges will always be rebased on top of the master branch before merging making the merge commit "Merge branch some_feature ..." unnecessary) (enabled by Bryce)
      Should be reverted as the "Rebase button" is only shown for people having write permissions on the branch to be merged (i.e. typically only the requester) making it impossible to merge most MEs via web UI.
    • PRs are non-public right now (seems already fixed)
    • Consider moving inkscape-docs repo, board repo, windows devlibs repos etc. (and if done, remember to adapt website and wiki accordingly)
  • Organization
    • Perhaps send out invitations to devs who have not registered yet? This can be done from the 'members' tab of the 'Settings' page by project masters and owners.
    • Double-check permissions. Decide on whether Inkscape devs should be given developer status for all Inkscape subgroups, or only on their own subgroup.

Questions/Confusions

  • How does one get a list of branches?
    Answer: git branch lists local branches, git branch -r lists all branches (local and from all remotes).
  • How can one have a set of parallel branches: trunk, 0.92.x, 0.91.x ...?
    Answer: See frontpage, Working with Git#Checkout multiple branches into different folders
  • Should it be 'origin/0.92.x' rather than '0.92.x'?
    Answer: 'origin/0.92.x' references the branch '0.92.x' in the remote called 'origin' (typically this is the repository that you initially cloned). The locally checked out branch is referred to by plain '0.92.x'. You can other remotes (e.g. 'upstream') and reference those as 'upstream/0.92.x'

Get full commit history

(probably needs to be placed somewhere else eventually, Eduard (talk) 03:11, 12 June 2017 (UTC))

I just found out, that our git import has the full history back to 2003-10-30 (it's in 0.45.x/0.46.x branches) while trunk only reaches back to 2006-01-16 (we're missing 8691 revisions in total).

 179fa413b047bede6e32109e2ce82437c5fb8d34  -->  first commit in trunk/master
 971d8ce896dc59d3ec6430610d6ae28586c1301f  -->  the same commit in 0.45.x/0.46.x (but has no relationship with trunk/master)
 9ed8de136577ccaaae3289dd4165171573c7bcbc  -->  initial commit in 0.45.x/0.46.x

Nice thing about git: We can stitch together both histories using git-replace!

A simple

 git replace 179fa413b047bede6e32109e2ce82437c5fb8d34 971d8ce896dc59d3ec6430610d6ae28586c1301f

will tell git that it should replace the first commit in trunk/master with the same commit in 0.45.x/0.46.x.

As a result all revisions descending from 179fa413b047bede6e32109e2ce82437c5fb8d34 will now have proper ancestry reaching back to 9ed8de136577ccaaae3289dd4165171573c7bcbc.