RFR: 8135292: Remove duplicate code in <OS>Address.java in SA [v2]

Jayashree Huttanagoudar duke at openjdk.org
Thu Jun 23 16:48:34 UTC 2022


On Wed, 22 Jun 2022 16:46:54 GMT, Severin Gehwolf <sgehwolf at openjdk.org> wrote:

>> Oops! previously I was not know that I should not force push and should not edit commit message so this time I took care of those points. But, rebase is also not suggested :(
>> I did so because after making suggested review changes, when I tried,
>> 
>> $ git add <changed files>
>> $ git commit --amend --no-edit
>> $ git push <remote-to-my-fork> <PR_Branch> 
>> To https://urldefense.com/v3/__https://github.com/jhuttana/jdk.git__;!!ACWV5N9M2RV99hQ!KnmLjeskdH-T5jQZAvD2kjmjWPuiLvOnl4QM-OqCNAKi_ZJ7bUkUiIT00ZrbPgnau9zfZgBbkFc45syM_nU-Zeci$ 
>>  ! [rejected]                JDK-8135292 -> JDK-8135292 (non-fast-forward)
>> error: failed to push some refs to 'https://urldefense.com/v3/__https://github.com/jhuttana/jdk.git__;!!ACWV5N9M2RV99hQ!KnmLjeskdH-T5jQZAvD2kjmjWPuiLvOnl4QM-OqCNAKi_ZJ7bUkUiIT00ZrbPgnau9zfZgBbkFc45syM_nU-Zeci$ '
>> hint: Updates were rejected because the tip of your current branch is behind
>> hint: its remote counterpart. Integrate the remote changes (e.g.
>> hint: 'git pull ...') before pushing again.
>> hint: See the 'Note about fast-forwards' in 'git push --help' for details.
>> 
>> So I thought I should git pull. 
>> 
>> # git pull
>> hint: You have divergent branches and need to specify how to reconcile them.
>> hint: You can do so by running one of the following commands sometime before
>> hint: your next pull:
>> hint: 
>> hint:   git config pull.rebase false  # merge
>> hint:   git config pull.rebase true   # rebase
>> hint:   git config pull.ff only       # fast-forward only
>> hint: 
>> hint: You can replace "git config" with "git config --global" to set a default
>> hint: preference for all repositories. You can also pass --rebase, --no-rebase,
>> hint: or --ff-only on the command line to override the configured default per
>> hint: invocation.
>> 
>> # git config pull.rebase true
>> # git pull
>> Auto-merging src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/bsd/BsdDebuggerLocal.java
>> CONFLICT (content): Merge conflict in src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/bsd/BsdDebuggerLocal.java
>> Auto-merging src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/dummy/DummyDebugger.java
>> CONFLICT (content): Merge conflict in src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/dummy/DummyDebugger.java
>> Auto-merging src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/linux/LinuxDebuggerLocal.java
>> CONFLICT (content): Merge conflict in src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/linux/LinuxDebuggerLocal.java
>> Auto-merging src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/remote/RemoteDebuggerClient.java
>> CONFLICT (content): Merge conflict in src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/remote/RemoteDebuggerClient.java
>> Auto-merging src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/windbg/WindbgDebuggerLocal.java
>> CONFLICT (content): Merge conflict in src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/windbg/WindbgDebuggerLocal.java
>> error: could not apply da58aea47c8... 8135291: Removed duplicate code in <OS>Address.java and related files in SA
>> hint: Resolve all conflicts manually, mark them as resolved with
>> hint: "git add/rm <conflicted_files>", then run "git rebase --continue".
>> hint: You can instead skip this commit: run "git rebase --skip".
>> hint: To abort and get back to the state before "git rebase", run "git rebase --abort".
>> Could not apply da58aea47c8... 8135291: Removed duplicate code in <OS>Address.java and related files in SA -After asLongValue() added to interface Address.java, there no need to have the getValue() in every instance Address.java
>> 
>> # git add src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/bsd/BsdDebuggerLocal.java src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/dummy/DummyDebugger.java src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/linux/LinuxDebuggerLocal.java src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/remote/RemoteDebuggerClient.java src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/windbg/WindbgDebuggerLocal.java
>> 
>> # git rebase --continue
>> [detached HEAD 7af119a55b8] 8135291: Removed duplicate code in <OS>Address.java and related files in SA -After asLongValue() added to interface Address.java, there no need to have the getValue() in every instance Address.java
>>  5 files changed, 5 insertions(+), 5 deletions(-)
>> Successfully rebased and updated refs/heads/JDK-8135292.
>> 
>> # git push upstream JDK-8135292
>> Username for 'https://urldefense.com/v3/__https://github.com__;!!ACWV5N9M2RV99hQ!KnmLjeskdH-T5jQZAvD2kjmjWPuiLvOnl4QM-OqCNAKi_ZJ7bUkUiIT00ZrbPgnau9zfZgBbkFc45syM_qMzBcCQ$ ': jhuttana
>> Password for 'https://urldefense.com/v3/__https://jhuttana@github.com__;!!ACWV5N9M2RV99hQ!KnmLjeskdH-T5jQZAvD2kjmjWPuiLvOnl4QM-OqCNAKi_ZJ7bUkUiIT00ZrbPgnau9zfZgBbkFc45syM_n5U7x19$ ': 
>> Enumerating objects: 37, done.
>> Counting objects: 100% (37/37), done.
>> Delta compression using up to 16 threads
>> Compressing objects: 100% (18/18), done.
>> Writing objects: 100% (20/20), 9.66 KiB | 3.22 MiB/s, done.
>> Total 20 (delta 15), reused 0 (delta 0), pack-reused 0
>> remote: Resolving deltas: 100% (15/15), completed with 14 local objects.
>> To https://urldefense.com/v3/__https://github.com/jhuttana/jdk.git__;!!ACWV5N9M2RV99hQ!KnmLjeskdH-T5jQZAvD2kjmjWPuiLvOnl4QM-OqCNAKi_ZJ7bUkUiIT00ZrbPgnau9zfZgBbkFc45syM_nU-Zeci$ 
>>    8c61d54f1e3..7af119a55b8  JDK-8135292 -> JDK-8135292
>> 
>> 
>> 
>> Could you please let me know where did I went wrong?
>
>> ```
>> $ git add <changed files>
>> $ git commit --amend --no-edit
>>```
> 
> The `git commit --amend` changes the current commit. Don't use `--amend` and it should be fine.

@jerboaa as per your suggestion I tried adding a relevant commit message and it worked fine. Thank you!

-------------

PR: https://git.openjdk.org/jdk/pull/9112


More information about the serviceability-dev mailing list