From b6781f9effd846033e0f886e76c1161bb365a522 Mon Sep 17 00:00:00 2001 From: janetlndavis Date: Tue, 14 Feb 2017 17:58:45 -0800 Subject: [PATCH 01/14] Link to GitHub Classroom assignment --- activity.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/activity.md b/activity.md index 07b2bc8..a01b048 100644 --- a/activity.md +++ b/activity.md @@ -20,7 +20,7 @@ In this activity your team will play out several scenarios of concurrent develop ## Setup the project -- Help your maintainer to create a new project on GitHub named `favorites` and add the other team members as contributors. +- Create a new repository through GitHub Classroom: https://classroom.github.com/group-assignment-invitations/e592a0be645631543daeb5262a857163 ## Contributor-1 setup From 95049e34888873753cc1f68e1e5b807a2629a869 Mon Sep 17 00:00:00 2001 From: janetlndavis Date: Tue, 14 Feb 2017 17:59:34 -0800 Subject: [PATCH 02/14] Update activity.md --- activity.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/activity.md b/activity.md index a01b048..04dc24c 100644 --- a/activity.md +++ b/activity.md @@ -20,7 +20,7 @@ In this activity your team will play out several scenarios of concurrent develop ## Setup the project -- Create a new repository through GitHub Classroom: https://classroom.github.com/group-assignment-invitations/e592a0be645631543daeb5262a857163 +- Create a new team and repository through GitHub Classroom: https://classroom.github.com/group-assignment-invitations/e592a0be645631543daeb5262a857163 ## Contributor-1 setup From 62804be5d02bee6d300c27b33bc832e173d8509a Mon Sep 17 00:00:00 2001 From: janetlndavis Date: Tue, 14 Feb 2017 18:11:46 -0800 Subject: [PATCH 03/14] Update activity.md --- activity.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/activity.md b/activity.md index 04dc24c..678a315 100644 --- a/activity.md +++ b/activity.md @@ -38,7 +38,7 @@ Help contributor-1 to follow the [GitHub flow](https://guides.github.com/introdu Help the maintainer to [merge contributor-1's pull request](https://help.github.com/articles/merging-a-pull-request/) on GitHub and then [delete the branch](https://help.github.com/articles/deleting-unused-branches/). -Help contributor-1 to switch to the master branch and [pull changes](https://netbeans.org/kb/docs/ide/git.html#pull) from the remote master. Then, clean up by [deleting the local development branch](https://netbeans.org/kb/docs/ide/git.html#branchDelete). +Help contributor-1 to switch to their local master branch and [pull changes](https://netbeans.org/kb/docs/ide/git.html#pull) from the remote master. Then, clean up by [deleting the local development branch](https://netbeans.org/kb/docs/ide/git.html#branchDelete). Congratulations, your team has made its first contribution! Celebrate. @@ -66,9 +66,9 @@ Celebrate. But keep it small. Don't worry, there will be bigger celebrations lat - Maintainer, accept one of the pull requests. Try to accept the other. You won't be able to because changes in the pull request conflict with the other that you already accepted. -- Help the contributor with the unresolved pull request to pull changes from GitHub - to the local master and rebase their development branch. Then push - the development branch to GitHub. +- Help the contributor with the unresolved pull request to switch to their local master branch, + pull changes from GitHub, switch to their development branch, and rebase it relative to the master branch. + Then push the development branch to GitHub. - Maintainer, note that the conflicted pull request is automatically updated and should be acceptable. Accept the pull request. - Have contributors clean up. From 2df2c2aca34fc0ab65141c58788e69b6070a1f21 Mon Sep 17 00:00:00 2001 From: janetlndavis Date: Tue, 14 Feb 2017 18:20:30 -0800 Subject: [PATCH 04/14] Update activity.md --- activity.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/activity.md b/activity.md index 678a315..010e2db 100644 --- a/activity.md +++ b/activity.md @@ -68,7 +68,8 @@ Celebrate. But keep it small. Don't worry, there will be bigger celebrations lat that you already accepted. - Help the contributor with the unresolved pull request to switch to their local master branch, pull changes from GitHub, switch to their development branch, and rebase it relative to the master branch. - Then push the development branch to GitHub. + In the rebase dialog, you want the Rebased Branch to be the development branch and the Destination branch to be the master branch. + Once the development branch is rebased, push it to GitHub. - Maintainer, note that the conflicted pull request is automatically updated and should be acceptable. Accept the pull request. - Have contributors clean up. From da5ae7ac50eb4eda4dd630d35847988f97478c49 Mon Sep 17 00:00:00 2001 From: janetlndavis Date: Wed, 15 Feb 2017 09:48:32 -0800 Subject: [PATCH 05/14] Updated beginning instructions --- activity.md | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/activity.md b/activity.md index 010e2db..17e4329 100644 --- a/activity.md +++ b/activity.md @@ -20,23 +20,25 @@ In this activity your team will play out several scenarios of concurrent develop ## Setup the project -- Create a new team and repository through GitHub Classroom: https://classroom.github.com/group-assignment-invitations/e592a0be645631543daeb5262a857163 +- Help the maintainer to create a new team and repository through GitHub Classroom. Do not join my TEST team. +https://classroom.github.com/group-assignment-invitations/e592a0be645631543daeb5262a857163 ## Contributor-1 setup -- Help Contributor-1 to [clone](https://netbeans.org/kb/docs/ide/git.html#clone) the project in NetBeans. +- Help Contributor-1 to [clone](https://netbeans.org/kb/docs/ide/git.html#clone) the repository in NetBeans. ## First contribution Help contributor-1 to follow the [GitHub flow](https://guides.github.com/introduction/flow/): -- [Create a new branch.](https://netbeans.org/kb/docs/ide/git.html#branchCreate) -- Create a new file `favorite-foods.txt` that contains a couple of contributor-1's - favorite foods. -- [Add and commit the new file.](https://netbeans.org/kb/docs/ide/git.html#add) +- [Create a new development branch.](https://netbeans.org/kb/docs/ide/git.html#branchCreate) +- Edit +- Edit Main.java to make the main method print out a few favorite foods. - [Push](https://netbeans.org/kb/docs/ide/git.html#push) the new branch to GitHub. - On GitHub, [make a pull request](https://help.github.com/articles/creating-a-pull-request/) to pull the new branch into the master branch. -Help the maintainer to [merge contributor-1's pull request](https://help.github.com/articles/merging-a-pull-request/) on GitHub and then [delete the branch](https://help.github.com/articles/deleting-unused-branches/). +Good GitHub practice: *Never merge your own pull request.* Another team member should review your code. + +Help the maintainer to [merge contributor-1's pull request](https://help.github.com/articles/merging-a-pull-request/) on GitHub and then [delete the branch](https://help.github.com/articles/deleting-unused-branches/). Help contributor-1 to switch to their local master branch and [pull changes](https://netbeans.org/kb/docs/ide/git.html#pull) from the remote master. Then, clean up by [deleting the local development branch](https://netbeans.org/kb/docs/ide/git.html#branchDelete). From 0f0e628c6d13c2a8d5d27de5a8089d8234285e09 Mon Sep 17 00:00:00 2001 From: janetlndavis Date: Wed, 15 Feb 2017 10:09:41 -0800 Subject: [PATCH 06/14] Updated later steps for the move to Java --- activity.md | 48 ++++++++++++++++++++++++++++++------------------ 1 file changed, 30 insertions(+), 18 deletions(-) diff --git a/activity.md b/activity.md index 17e4329..f656249 100644 --- a/activity.md +++ b/activity.md @@ -6,13 +6,13 @@ Work with your Project 3 team. If you are in a team of 4, form two 2-person teams. Assign the following roles to the members of your team. If you are in a team -of 2, then both team members will take turns playing the role of the maintainer. +of 2, then each team member will play the role of maintainer for the other's contributions. Roles: -- Maintainer: Creates and maintains a GitHub project. -- Contributor-1: Contributes to the GitHub project created by the maintainer. -- Contributor-2: Contributes to the GitHub project created by the maintainer. +- Maintainer: Creates and maintains a GitHub repository. +- Contributor-1: Contributes to the GitHub repository created by the maintainer. +- Contributor-2: Contributes to the GitHub repository created by the maintainer. ## Overview @@ -25,7 +25,7 @@ https://classroom.github.com/group-assignment-invitations/e592a0be645631543daeb5 ## Contributor-1 setup -- Help Contributor-1 to [clone](https://netbeans.org/kb/docs/ide/git.html#clone) the repository in NetBeans. +- Help Contributor-1 to [clone](https://netbeans.org/kb/docs/ide/git.html#clone) the repository in NetBeans. It is pre-populated with a basic NetBeans project named Favorites. ## First contribution @@ -33,12 +33,13 @@ Help contributor-1 to follow the [GitHub flow](https://guides.github.com/introdu - [Create a new development branch.](https://netbeans.org/kb/docs/ide/git.html#branchCreate) - Edit - Edit Main.java to make the main method print out a few favorite foods. +- [Commit](https://netbeans.org/kb/docs/ide/git.html#committing) the changes. - [Push](https://netbeans.org/kb/docs/ide/git.html#push) the new branch to GitHub. - On GitHub, [make a pull request](https://help.github.com/articles/creating-a-pull-request/) to pull the new branch into the master branch. Good GitHub practice: *Never merge your own pull request.* Another team member should review your code. -Help the maintainer to [merge contributor-1's pull request](https://help.github.com/articles/merging-a-pull-request/) on GitHub and then [delete the branch](https://help.github.com/articles/deleting-unused-branches/). +Help the maintainer to [merge contributor-1's pull request](https://help.github.com/articles/merging-a-pull-request/) on GitHub and then [delete the branch](https://help.github.com/articles/deleting-unused-branches/) on GitHub. Help contributor-1 to switch to their local master branch and [pull changes](https://netbeans.org/kb/docs/ide/git.html#pull) from the remote master. Then, clean up by [deleting the local development branch](https://netbeans.org/kb/docs/ide/git.html#branchDelete). @@ -47,10 +48,8 @@ Congratulations, your team has made its first contribution! Celebrate. ## Contributor-2 setup and second contribution -- Repeat the steps above to have contributor-2 contribute a new file - `favorite-movies.txt` with a couple of his/her favorite movies. -- Make sure that the maintainer has accepted contributor-2's pull request - and contributor-2 has updated their master and cleaned up. +- Repeat the steps above to have contributor-2 add a few of their favorite foods to the main method of the Main class. +- Make sure that the maintainer has accepted contributor-2's pull request and contributor-2 has updated their master and cleaned up. Celebrate again. @@ -64,35 +63,48 @@ Celebrate. But keep it small. Don't worry, there will be bigger celebrations lat ## Contribute conflicting changes - Have contributor-1 and contributor-2 independently follow the contribution - workflow to add another favorite food to the end of `favorite-foods.txt`. -- Maintainer, accept one of the pull requests. Try to accept the other. You + workflow to add one more favorite food to the end of the main method. +- Have the maintainer accept maintainer-1's pull request. Try to accept contributor-2's pull request. You won't be able to because changes in the pull request conflict with the other that you already accepted. -- Help the contributor with the unresolved pull request to switch to their local master branch, +- Help contributor-2 switch to their local master branch, pull changes from GitHub, switch to their development branch, and rebase it relative to the master branch. In the rebase dialog, you want the Rebased Branch to be the development branch and the Destination branch to be the master branch. Once the development branch is rebased, push it to GitHub. - Maintainer, note that the conflicted pull request is automatically updated and should be acceptable. Accept the pull request. -- Have contributors clean up. +- Have contributors clean up their extra branches. Celebrate enthusiastically. That was challenging. +## Refactoring + +- Have contributor-1 and contributor-2 independently follow the contribution workflow to make the following changes: + - Have contributor-1 add another food to the main method. + - Have contributor-2 make a new static method, movies(), that prints favorite movies. Also move the code to print favorite foods from the main method into a new static method, foods(). Modify the main function to call both methods (and do nothing else). +- Have the maintainer accept maintainer-2's pull request. Try to accept contributor-1's pull request. You + won't be able to because changes in the pull request *really, really* conflict with the other that you already accepted. +- Have contributor-1 pull changes from GitHub into their master branch and rebase their development branch as described above. Then revise the code to put the new favorite food into the new foods() method with the others. Commit and push the changes. +- Have the maintainer accept contributor-2's updated pull request. + +Celebrate wildly. That was even more challenging. + + ## Multi-round contribution -- Have contributor-1 add another food, and contributor-2 another movie. +- Have contributor-1 add another food to the foods() method. +- Have contributor-2 add another movie to the movies() method. - Have the maintainer ask for a modification through the pull-request (e.g., "Please pick another flavor. I don't like chocolate."). - Have contributors make, commit, and push the new changes. -- If the maintainer is satisfied, accept the pull-requests. +- If the maintainer is satisfied, accept the pull requests. - Contributors, don't forget to clean up. -Notice how pull-requests provide a way for a contributor and a maintainer to +Notice how pull-requests provide a way for team members to communicate about a proposed change. Also notice how the pull-request updates automatically as new changes are pushed to the same branch. - ## Squash - Repeat the multi-round contribution until both contributors have made multiple From 4c6b54fc9ada4786e982b2e8723c316863cb42c0 Mon Sep 17 00:00:00 2001 From: janetlndavis Date: Wed, 15 Feb 2017 10:10:09 -0800 Subject: [PATCH 07/14] Fixed a typo - dup text --- activity.md | 1 - 1 file changed, 1 deletion(-) diff --git a/activity.md b/activity.md index f656249..f8c3eb7 100644 --- a/activity.md +++ b/activity.md @@ -31,7 +31,6 @@ https://classroom.github.com/group-assignment-invitations/e592a0be645631543daeb5 Help contributor-1 to follow the [GitHub flow](https://guides.github.com/introduction/flow/): - [Create a new development branch.](https://netbeans.org/kb/docs/ide/git.html#branchCreate) -- Edit - Edit Main.java to make the main method print out a few favorite foods. - [Commit](https://netbeans.org/kb/docs/ide/git.html#committing) the changes. - [Push](https://netbeans.org/kb/docs/ide/git.html#push) the new branch to GitHub. From 3a95f13b1edc5dcbe72c2088a5b9e9044e16c7ad Mon Sep 17 00:00:00 2001 From: janetlndavis Date: Wed, 15 Feb 2017 10:22:13 -0800 Subject: [PATCH 08/14] Update activity.md --- activity.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/activity.md b/activity.md index f8c3eb7..a81381c 100644 --- a/activity.md +++ b/activity.md @@ -40,7 +40,9 @@ Good GitHub practice: *Never merge your own pull request.* Another team member s Help the maintainer to [merge contributor-1's pull request](https://help.github.com/articles/merging-a-pull-request/) on GitHub and then [delete the branch](https://help.github.com/articles/deleting-unused-branches/) on GitHub. -Help contributor-1 to switch to their local master branch and [pull changes](https://netbeans.org/kb/docs/ide/git.html#pull) from the remote master. Then, clean up by [deleting the local development branch](https://netbeans.org/kb/docs/ide/git.html#branchDelete). +Help contributor-1 to switch to their local master branch and [pull changes](https://netbeans.org/kb/docs/ide/git.html#pull) from the remote master. Use the **Team > Remote > Pull...** dialog, click **Enable Deletes**, and allow it to delete the local clone of the remote development branch. + +Then, clean up by [deleting the local development branch](https://netbeans.org/kb/docs/ide/git.html#branchDelete). Congratulations, your team has made its first contribution! Celebrate. From f41fbe225001b46484ef7c39d7a691e6fba86bb1 Mon Sep 17 00:00:00 2001 From: janetlndavis Date: Wed, 15 Feb 2017 10:47:49 -0800 Subject: [PATCH 09/14] Update activity.md --- activity.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/activity.md b/activity.md index a81381c..844d2d9 100644 --- a/activity.md +++ b/activity.md @@ -71,7 +71,8 @@ Celebrate. But keep it small. Don't worry, there will be bigger celebrations lat - Help contributor-2 switch to their local master branch, pull changes from GitHub, switch to their development branch, and rebase it relative to the master branch. In the rebase dialog, you want the Rebased Branch to be the development branch and the Destination branch to be the master branch. - Once the development branch is rebased, push it to GitHub. + You will need to merge conflicting changes and then continue the rebase. + Once the development branch is rebased, commit the changes and push to GitHub. - Maintainer, note that the conflicted pull request is automatically updated and should be acceptable. Accept the pull request. - Have contributors clean up their extra branches. From bc79d57fa835950b7677997837d1550ba3fdc132 Mon Sep 17 00:00:00 2001 From: janetlndavis Date: Wed, 15 Feb 2017 10:58:00 -0800 Subject: [PATCH 10/14] Note about difficulties with rebasing. --- activity.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/activity.md b/activity.md index 844d2d9..8d59a72 100644 --- a/activity.md +++ b/activity.md @@ -70,8 +70,7 @@ Celebrate. But keep it small. Don't worry, there will be bigger celebrations lat that you already accepted. - Help contributor-2 switch to their local master branch, pull changes from GitHub, switch to their development branch, and rebase it relative to the master branch. - In the rebase dialog, you want the Rebased Branch to be the development branch and the Destination branch to be the master branch. - You will need to merge conflicting changes and then continue the rebase. + *I have been having a difficult time figuring out how to do this in NetBeans. Call me over when you get here.* Once the development branch is rebased, commit the changes and push to GitHub. - Maintainer, note that the conflicted pull request is automatically updated and should be acceptable. Accept the pull request. From 7c4d666446c3f73f8476db14cb7a195cfa454e4c Mon Sep 17 00:00:00 2001 From: janetlndavis Date: Wed, 15 Feb 2017 11:24:02 -0800 Subject: [PATCH 11/14] Update activity.md --- activity.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/activity.md b/activity.md index 8d59a72..6b84971 100644 --- a/activity.md +++ b/activity.md @@ -68,10 +68,9 @@ Celebrate. But keep it small. Don't worry, there will be bigger celebrations lat - Have the maintainer accept maintainer-1's pull request. Try to accept contributor-2's pull request. You won't be able to because changes in the pull request conflict with the other that you already accepted. -- Help contributor-2 switch to their local master branch, - pull changes from GitHub, switch to their development branch, and rebase it relative to the master branch. +- Help contributor-2 switch to rebase their development branch relative to the updated master branch. *I have been having a difficult time figuring out how to do this in NetBeans. Call me over when you get here.* - Once the development branch is rebased, commit the changes and push to GitHub. + Once the development branch is rebased, push to GitHub. - Maintainer, note that the conflicted pull request is automatically updated and should be acceptable. Accept the pull request. - Have contributors clean up their extra branches. From 56e745f50edd6849524b88f42467f6090e71eee9 Mon Sep 17 00:00:00 2001 From: janetlndavis Date: Wed, 15 Feb 2017 11:33:01 -0800 Subject: [PATCH 12/14] Update activity.md --- activity.md | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/activity.md b/activity.md index 6b84971..4e8a2de 100644 --- a/activity.md +++ b/activity.md @@ -68,9 +68,18 @@ Celebrate. But keep it small. Don't worry, there will be bigger celebrations lat - Have the maintainer accept maintainer-1's pull request. Try to accept contributor-2's pull request. You won't be able to because changes in the pull request conflict with the other that you already accepted. -- Help contributor-2 switch to rebase their development branch relative to the updated master branch. +- Help contributor-2 switch to rebase their development branch relative to the updated master branch. Close Netbeans and open a terminal. +*Work in progress* +```bash +$ git fetch upstream master:master (18) +$ git rebase master (19) +$ vim file1 (*20) +$ git add . (21) +$ git rebase --continue (22) +$ git push -f origin master (23) +``` *I have been having a difficult time figuring out how to do this in NetBeans. Call me over when you get here.* - Once the development branch is rebased, push to GitHub. +- Once the development branch is rebased, push to GitHub. - Maintainer, note that the conflicted pull request is automatically updated and should be acceptable. Accept the pull request. - Have contributors clean up their extra branches. From 1d4f62881171294d11635b8757535af66b4ac49b Mon Sep 17 00:00:00 2001 From: janetlndavis Date: Wed, 15 Feb 2017 11:42:56 -0800 Subject: [PATCH 13/14] Update activity.md --- activity.md | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/activity.md b/activity.md index 4e8a2de..9bd13e9 100644 --- a/activity.md +++ b/activity.md @@ -69,17 +69,17 @@ Celebrate. But keep it small. Don't worry, there will be bigger celebrations lat won't be able to because changes in the pull request conflict with the other that you already accepted. - Help contributor-2 switch to rebase their development branch relative to the updated master branch. Close Netbeans and open a terminal. -*Work in progress* ```bash -$ git fetch upstream master:master (18) -$ git rebase master (19) -$ vim file1 (*20) -$ git add . (21) -$ git rebase --continue (22) -$ git push -f origin master (23) +$ cd NetBeans/workflow-activity- +$ git fetch origin master:master +$ git rebase master +$ vi Favorites/src/favorites/Main.java + # or use whatever text editor you prefer to resolve the conflict - call me if you need help +$ git add . +$ git rebase --continue +$ git push -f origin master ``` - *I have been having a difficult time figuring out how to do this in NetBeans. Call me over when you get here.* -- Once the development branch is rebased, push to GitHub. +- Contributor-2, check the status of your development branch on GitHub. You should see the merged changes. Now you can open NetBeans again. - Maintainer, note that the conflicted pull request is automatically updated and should be acceptable. Accept the pull request. - Have contributors clean up their extra branches. From 4b52afdc43ce624aed757d0af135ebf7818e4a7f Mon Sep 17 00:00:00 2001 From: janetlndavis Date: Wed, 15 Feb 2017 11:56:12 -0800 Subject: [PATCH 14/14] Fixed path typo --- activity.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/activity.md b/activity.md index 9bd13e9..fdb4b97 100644 --- a/activity.md +++ b/activity.md @@ -70,7 +70,7 @@ Celebrate. But keep it small. Don't worry, there will be bigger celebrations lat that you already accepted. - Help contributor-2 switch to rebase their development branch relative to the updated master branch. Close Netbeans and open a terminal. ```bash -$ cd NetBeans/workflow-activity- +$ cd NetBeansProjects/workflow-activity- # Your teamname in place of , or hit tab $ git fetch origin master:master $ git rebase master $ vi Favorites/src/favorites/Main.java