Hi Vladimir,

Some comments inlined below.

El 27/7/20 a las 23:32, [email protected] escribió:
Hello.

I have some free time and I have decided to help NetBeans to be better.

Thank you very much. We need help from everybody.


I have found old issue that I have found in 2018 year. It is
<https://issues.apache.org/jira/browse/NETBEANS-626> NETBEANS-626 Number of
row in "Insert Record(s)" modal panel is left after removming row JDK 10
only. It is not important issue, I have selected it for my first test.

Good.


Description of this JIRA issue is not correct ( I have found it only now).
This problem happens in any JDK.

It happens because JXTableRowHeader does not know about last removed record
in panel "Insert record(s)". What is interesting, if user sort table with
data, sorted table model informs JXTableRowHeader about changes.

I see.


I have prepared such possible fix
https://github.com/Enroi/netbeans/commit/5de23a97b8219a1448f18638ba68965ee47
caaf9

I have such questions:

1.      Is it correct format of commit?

The content of the commit looks ok to me, I mean, the Java is perfectly correct.

The format of the commit is not, though. We use "git" differently. We have documented how to use git in [1] (we have to improve that documentation, I'm afraid).

We use a technique that is similar to many other open source projects. We use "pull requests" to receive contributions from everybody (committers or users).

This is how the technique works:

a) You create a "fork" repository in github. You've already done this correctly in https://github.com/Enroi/netbeans.

b) You clone this repository in your hard disk, in a directory that you want (say "C:\MyNetBeansClone" in Windows or "/home/vladimir/REPOS/my-netbeans-clone", or wherever you want):

git clone https://github.com/Enroi/netbeans.git

c) Now is where things get a little bit different: in your directory you tell git that you will be using _another_ remote repository from Apache NetBeans, that you will be calling "upstream" (you can call it whatever you want, "netbeans" or "asf-netbeans" or whatever, people usually use "upstream"):

$ cd REPOS/my-netbeans-clone
REPOS/my-netbeans-clone$ git remote add upstream https://github.com/apache/netbeans.git

By doing so you're telling git that you will be using two different "remotes":

- "origin", an alias for your repository https://github.com/ENroi/netbeans.git - "upstream", an alias for the Apache NetBeans repository https://github.com/apache/netbeans.git

At any time you can ask git to show you the "remotes" that you are using using "git remote -v". For instance, in my local clone of NetBeans I have:

$ git remote -v
jiri    [email protected]:jkovalsky/netbeans.git (fetch)
jiri    [email protected]:jkovalsky/netbeans.git (push)
origin  [email protected]:vieiro/netbeans.git (fetch)
origin  [email protected]:vieiro/netbeans.git (push)
upstream        [email protected]:apache/netbeans.git (fetch)
upstream        [email protected]:apache/netbeans.git (push)

This is, I have not two, but three! "remotes".

For detailed instructions on how to do this you can take a look at [2] (which is better documented than our page, I think).

d) We never push to "master" directly.

One important think to understand is that we _never_ push to "master" directly, we only merge "pull requests" to master.

What we do is:

d.1) We synchronize the "master" branch between upstream and origin (we do this from time to time)

# We refresh all branches from "origin" and "upstream"
git fetch --all
# We change to our "local copy of master" branch
git checkout master
# We bring the changes from netbeans ("upstream") and
# we update our "local copy of master" branch
git merge upstream/master
# Now that our "local copy of master" branch is updated
# we send it to our fork in github
git push origin

d.2) For each new feature/bugfix we create a new branch on our
repository:

# We change to our "local copy of master"
git checkout master
# We create a new branch (name is of your liking, we
# usually use the name of the bugfix)
git checkout -b bugfix/NETBEANS-626

d.3) We correct the bug there.

We then add Java code to solve the bugfix (or add a new feature, or whatever). We do this by compiling and debugging our local copy of NetBeans (using ant).

d.4) We push our "new branch" to github

# We add the files
git add (files you want to add)
# We create a commit with an appropriate message
git commit -m "[NETBEANS-626] Your message here".
# We push the change (-u creates a new branch)
# to our git fork in github ("origin").
git push -u origin bugfix/NETBEANS-626

e) We create a "pull request"

When you create a new branch github will show you a green button in https://github.com/Enroi/netbeans asking if you want to create a "Pull Request" from the branch "bugfix/NETBEANS-626" to NetBeans' "master".

Just click yes, add some message there and you're all set.

By doing this the NetBeans team will receive a "Pull Request", very much like [3].

f) Wait and see

Then a NetBeans committer will review your pull request and see if it's good or not.

If the committer asks you to do some change then just change it and push it again to the same branch:

- modify the code if requested.
git add [your changes]
git commit -m "[NETBEANS-626] Added changes X, Y, Z"
git push

And go again to "f) Wait and see" until your changes are accepted.

This may seem very complicated, but once you're used to it it's very fast and very clean. It also allows the committers to go look at your code when time permits (committers are not paid for doing this, so they do have to have another job for a living :-)).


2.      Is it good fix, or should I change something?

It is a good fix. You need to create a pull request with the instructions above.

Also you need to remove your commit from your "master" branch (remember that your "master" branch must be _always_ a copy of NetBeans "master" branch).

3.      Is there anything more important for my help? Or I can work with
some another JIRA ticket I have created before.

It is very important to have fun.

You may want to send us an email to this mailing list before you start working.

For instance, if you create a JIRA ticked "Make NetBeans cook coffee for me in the mornings" and start working in it then maybe some committer does not like coffee in the mornings (!!??) and will reject your code.

So feel free to ask us before start doing things, to find out if we like coffee in the mornings :-).


Orlyanskiy Vladimir.



Thank you very much,
Antonio



[1]
http://netbeans.apache.org/participate/submit-pr.html#_contributing_to_apache_netbeans_in_github

[2]
https://www.dataschool.io/how-to-contribute-on-github/

[3]
https://github.com/apache/netbeans/pull/2277


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists



Reply via email to