Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 66FB0200B8F for ; Fri, 30 Sep 2016 23:14:54 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 658D9160AD9; Fri, 30 Sep 2016 21:14:54 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 5E3DB160AB4 for ; Fri, 30 Sep 2016 23:14:53 +0200 (CEST) Received: (qmail 22610 invoked by uid 500); 30 Sep 2016 21:14:47 -0000 Mailing-List: contact dev-help@airavata.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@airavata.apache.org Delivered-To: mailing list dev@airavata.apache.org Received: (qmail 22599 invoked by uid 99); 30 Sep 2016 21:14:47 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 30 Sep 2016 21:14:47 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id D0775C0DCC for ; Fri, 30 Sep 2016 21:14:46 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 2.398 X-Spam-Level: ** X-Spam-Status: No, score=2.398 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=2, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, RCVD_IN_SORBS_SPAM=0.5, SPF_PASS=-0.001] autolearn=disabled Authentication-Results: spamd4-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id F7RSsWjGAVQd for ; Fri, 30 Sep 2016 21:14:44 +0000 (UTC) Received: from mail-oi0-f47.google.com (mail-oi0-f47.google.com [209.85.218.47]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTPS id D13545FB90 for ; Fri, 30 Sep 2016 21:14:43 +0000 (UTC) Received: by mail-oi0-f47.google.com with SMTP id w11so144613766oia.2 for ; Fri, 30 Sep 2016 14:14:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=K1KYApDm/r/wvSuNo0FVfcqoSqC7Og0TOwRM3ZvhAZc=; b=OO5Kc1gn0mm/uuXVDRCGlmmxioQGdEURPizCJScEMFgUf8pxWCivSX4KGT0a7b+l2m GPARTWjap22FehTiS6iA2FVejGby90682z4Sf36SBuwewjrITHz2BOxPnZuj+phbBLdl xeRH9WflhwFQ6rN+iDxQW74+WCWTdxjhKYI8TlLosnxH3iPsRvLmd0hsR08oQH9Dy2EN /VpzB1tD3bZ98pe4Nl70bHp57QvdqARz6g5CkkvkNjrdUD8+Ahl1twGUEC2LZcZlSVr8 a+EwLjrdS8gReLiIISholkYq649P8JJh/fwc2KO4NmNrAI6NNyknGXSiqqCZX5UcjOsU VdmA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=K1KYApDm/r/wvSuNo0FVfcqoSqC7Og0TOwRM3ZvhAZc=; b=ibDxMfUrjKvAO4KPTpmEcj90SHZfJPbHpRpryPVTmj44jS3qhIX5JMvnmtNX8kWDb/ NoW7wsQQuexSXdu75+gUsQjQYhwjNGCVPyp4egWdUqFTS2d97mhWIz5owftfyPepVnRT 8BluqdjECd6GvPZ5zE8CreKPodLVvImKiR7hQU1LOjTayM5T4iBVrbWZq1NBb2edhYUn VVeauwh/fF2pHAt/I7QBrat/T/vla5tQQsKQWZt2DaOt6KjZTDb2kv2eSBWXDc/+T98K dvxb5WTq6A6Sc4G6OjC4pn82bKyOGmxh1jueONFKzl85+BNsu9eQGSalfrtbAnKGdkDn xaCQ== X-Gm-Message-State: AA6/9Rn2NQuayr9gLfqojRmQEJUwrU6+Qi9gtX9EVTPhQD1hAqQrxMvu7+JG0R4HTeAilm6ZZA421A0Chk6O5w== X-Received: by 10.157.58.2 with SMTP id j2mr6292348otc.166.1475270082625; Fri, 30 Sep 2016 14:14:42 -0700 (PDT) MIME-Version: 1.0 References: <61C5B3ED-9DA0-413E-918A-87025E09D730@indiana.edu> In-Reply-To: <61C5B3ED-9DA0-413E-918A-87025E09D730@indiana.edu> From: Shameera Rathnayaka Date: Fri, 30 Sep 2016 21:14:32 +0000 Message-ID: Subject: Re: Creating different PRs for different tasks To: "dev@airavata.apache.org" Content-Type: multipart/alternative; boundary=001a1147356e3907c6053dc015ae archived-at: Fri, 30 Sep 2016 21:14:54 -0000 --001a1147356e3907c6053dc015ae Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Hi Gourav, Nice! This is very useful details, should go to Airavata documentation for future reference. Regards, Shameera. On Fri, Sep 30, 2016 at 4:37 PM Shenoy, Gourav Ganesh wrote: > Hi dev, > > > > I recently faced a trivial problem due to my lack of understanding on how > we create different PRs for different tasks =E2=80=93 my code for differe= nt tasks > were getting added to the same PR because I was using a single branch to > commit my code & creating PRs from that branch. > > > > *Problem:* > > Eg: I forked the *airavata* repository and cloned the *develop* branch. I > worked on 2 tasks A, B. I pushed changes for A to my forked develop branc= h, > and created a PR #1. When I pushed changes for B to my forked develop and > tried creating a new PR, it added the new code to PR #1 (instead of > creating PR #2). > > > > *Solution (There might be other/better ways to do this):* > > Let me explain in a step by step manner. > > > > 1. Fork the =E2=80=9Capache/airavata=E2=80=9D repository to my pers= onal profile. > This will now be =E2=80=9Cgouravshenoy/airavata=E2=80=9D repository. > > > > 2. Since I will be working on the =E2=80=9Cdevelop=E2=80=9D branch,= I cloned the > develop branch from this forked repository. > > $ git clone =E2=80=93b develop git@github.com:gouravshenoy/airavata.git > > > > 3. I now create a new branch from my forked develop branch to work > on Task A. Say I name this branch =E2=80=9Ctask-A=E2=80=9D. > > $ git checkout =E2=80=93b task-A develop > > > > This will automatically switch to the new branch =E2=80=9Ctask-A=E2=80=9D= for me to work > on and commit my changes. > > > > 4. I make my changes and commit my code. I then push my code to > this new branch. > > $ git commit =E2=80=93m "changes for task-A" # commit changes > > $ git push --set-upstream origin task-A # push changes to new branch > > > > 5. Create a PR #1 for this task by comparing base =E2=80=9Capache/a= iravata > : develop=E2=80=9D with head =E2=80=9Cgouravshenoy/airavata : task-A=E2= =80=9D. > > > > 6. Similarly for Task B, I can create a new branch from =E2=80=9Cdevelop= =E2=80=9D and > commit my changes to it. > $ git checkout =E2=80=93b task-B develop > > $ git commit =E2=80=93m "changes for task-B" # commit changes > > $ git push --set-upstream origin task-B # push changes to new branch > > > > > > 7. I can then create a new PR #2 for this task by comparing base > =E2=80=9Capache/airavata : develop=E2=80=9D with head =E2=80=9Cgouravshen= oy/airavata : task-B=E2=80=9D. > > > > 8. Once the PR has been reviewed and the code merged, you can > safely delete these new branches. > $ git push origin :task-A > $ git push origin :task-B > > > > Again there might be other effective ways to do this, but this worked wel= l > for me and helped me understand better how we can create new PRs without > adding everything to one. Hope this helps! > > > > *Note: Also while pushing commits, it is recommended to add the JIRA issu= e > number to the commit so that Git automatically links the JIRA issue with > the commit/merge.* > > > > Thanks and Regards, > > Gourav Shenoy > --=20 Shameera Rathnayaka --001a1147356e3907c6053dc015ae Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Hi Gourav,=C2=A0

Nice! This is very use= ful details, should go to Airavata documentation for future reference.=C2= =A0

Regards,=C2=A0
Shameera.=C2=A0
<= br>

On Fri= , Sep 30, 2016 at 4:37 PM Shenoy, Gourav Ganesh <goshenoy@indiana.edu> wrote:

Hi dev,

=C2=A0

I recently faced a = trivial problem due to my lack of understanding on how we create different = PRs for different tasks =E2=80=93 my code for different tasks were getting = added to the same PR because I was using a single branch to commit my code & creating PRs from that branch.

=C2=A0

Problem:

Eg: I forked the airavata repository and cloned the develop branch. I worked on 2 tasks A, B. I pushed changes for A to = my forked develop branch, and created a PR #1. When I pushed changes for B = to my forked develop and tried creating a new PR, it added the new code to = PR #1 (instead of creating PR #2).

=C2=A0

Solution (The= re might be other/better ways to do this):

Let me explain in a= step by step manner.

=C2= =A0

1.=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 Fork the =E2= =80=9Capache/airavata=E2=80=9D repository to my personal profile. This will= now be =E2=80=9Cgouravshenoy/airavata=E2=80=9D repository.

=C2= =A0

2.=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 Since I will b= e working on the =E2=80=9Cdevelop=E2=80=9D branch, I cloned the develop bra= nch from this forked repository.

$ git clone =E2=80=93b develop git@github.com:gouravshenoy/airavata.git

=C2=A0

3.=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 I now create a= new branch from my forked develop branch to work on Task A. Say I name thi= s branch =E2=80=9Ctask-A=E2=80=9D.

$ git checkout =E2=80=93b task-A develop

=C2= =A0

This will a= utomatically switch to the new branch =E2=80=9Ctask-A=E2=80=9D for me to wo= rk on and commit my changes.

=C2=A0

4.=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 =C2=A0I make m= y changes and commit my code. I then push my code to this new branch.

$ git commit =E2=80=93m "changes for task-A"=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 # commit changes

$ gi= t push --set-upstream origin task-A=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 # push ch= anges to new branch

=C2=A0

5.=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 Create a PR #1= for this task by comparing base =E2=80=9Capache/airavata : develop=E2=80= =9D with head =E2=80=9Cgouravshenoy/airavata : task-A=E2=80=9D.

=C2=A0

6.=C2=A0 Similarly for = Task B, I can create a new branch from =E2=80=9Cdevelop=E2=80=9D and commit= my changes to it.
$ git checkout= =E2=80=93b task-B develop

$ git commit =E2=80=93m "changes for task-B"=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 # commit changes

$ gi= t push --set-upstream origin task-B=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 # push ch= anges to new branch

=C2=A0

=C2=A0

7.=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 I can then cre= ate a new PR #2 for this task by comparing base =E2=80=9Capache/airavata : = develop=E2=80=9D with head =E2=80=9Cgouravshenoy/airavata : task-B=E2=80=9D= .

=C2=A0

8.=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 Once the PR ha= s been reviewed and the code merged, you can safely delete these new branch= es.
$ git push origin :task-A
$ git push origin :task-B

=C2=A0

Again there might b= e other effective ways to do this, but this worked well for me and helped m= e understand better how we can create new PRs without adding everything to = one. Hope this helps!

=C2=A0

Note: Also while= pushing commits, it is recommended to add the JIRA issue number to the com= mit so that Git automatically links the JIRA issue with the commit/merge.

=C2=A0

Thanks and Regards,=

Gourav Shenoy

--
Shameera Rathnayaka
--001a1147356e3907c6053dc015ae--