Add topic while running repo upload

1,011 views
Skip to first unread message

Raviraj Karasulli

unread,
Dec 4, 2019, 1:54:33 AM12/4/19
to Repo and Gerrit Discussion
Hi,

We are adding a topic to a a review while uploading the change to gerrit with the git push command as explained below.




However, I am wondering how to add the TOPIC while running repo upload.
I tried below,

1. setting the  review topic in config as explained in the repo upload documentation.

"review.URL.uploadtopic:

To add a topic branch whenever uploading a commit, you can set a
per-project or global Git option to do so. If review.URL.uploadtopic is
set to "true" then repo will assume you always want the equivalent of
the -t option to the repo command. If unset or set to "false" then repo
will make use of only the command line option."

review.URL.uploadtopic=TESTING_UPLOAD 

With this, the change is uploaded, but topic is not set.

2. Tried using the   "-o PUSH_OPTIONS, --push-option=PUSH_OPTIONS"

not sure if I am using the right format or not, I tried below things with no success.

i. repo upload --push-option="-o topic=driver/i42"
ii. repo upload --push-option="topic=driver/i42"
iii. repo upload -o trace=test
iv. repo upload --push-option="%topic=TESTING"

Please let me know if adding topic while uploading is achievable.


David Pursehouse

unread,
Dec 4, 2019, 2:20:24 AM12/4/19
to Raviraj Karasulli, Repo and Gerrit Discussion
On Wed, Dec 4, 2019 at 3:54 PM Raviraj Karasulli <ravirajk...@gmail.com> wrote:
Hi,

We are adding a topic to a a review while uploading the change to gerrit with the git push command as explained below.




However, I am wondering how to add the TOPIC while running repo upload.
I tried below,

1. setting the  review topic in config as explained in the repo upload documentation.

"review.URL.uploadtopic:

To add a topic branch whenever uploading a commit, you can set a
per-project or global Git option to do so. If review.URL.uploadtopic is
set to "true" then repo will assume you always want the equivalent of
the -t option to the repo command. If unset or set to "false" then repo
will make use of only the command line option."

review.URL.uploadtopic=TESTING_UPLOAD 

With this, the change is uploaded, but topic is not set.

The expected value of the setting is "true" or "false".  It then overrides the -t option on the repo upload command to effectively always be activated.
 

2. Tried using the   "-o PUSH_OPTIONS, --push-option=PUSH_OPTIONS"

not sure if I am using the right format or not, I tried below things with no success.

i. repo upload --push-option="-o topic=driver/i42"
ii. repo upload --push-option="topic=driver/i42"
iii. repo upload -o trace=test
iv. repo upload --push-option="%topic=TESTING"

Please let me know if adding topic while uploading is achievable.


The usage is "repo upload -t" which will set the topic to whatever your local branch is named.

 

--
--
To unsubscribe, email repo-discuss...@googlegroups.com
More info at http://groups.google.com/group/repo-discuss?hl=en

---
You received this message because you are subscribed to the Google Groups "Repo and Gerrit Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to repo-discuss...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/repo-discuss/578f432b-ed3f-48c5-ba63-87eab45ccdb2%40googlegroups.com.

Raviraj Karasulli

unread,
Dec 4, 2019, 4:13:20 AM12/4/19
to Repo and Gerrit Discussion
Tried the following. Am I doing something wrong?

1. git checkout -b topic_1
Switched to a new branch 'topic_1'

2. git branch --set-upstream master
The --set-upstream flag is deprecated and will be removed. Consider using --track or --set-upstream-to
Branch master set up to track local branch topic_1.

3.  vi one
 git add .
 git status
On branch topic_1
Changes to be committed:
  (use "git reset HEAD <file>..." to unstage)

        new file:   one

 git commit -m "Adding a new file"
[topic_1 dff9150] Adding a new file
 1 file changed, 1 insertion(+)
 create mode 100644 one
 repo upload -t

... A new repo command ( 1.26) is available.
... You should upgrade soon:

    cp /test/.repo/repo/repo /usr/bin/repo

no branches ready for upload

--
--
To unsubscribe, email repo-d...@googlegroups.com

More info at http://groups.google.com/group/repo-discuss?hl=en

---
You received this message because you are subscribed to the Google Groups "Repo and Gerrit Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to repo-d...@googlegroups.com.

Raviraj Karasulli

unread,
Dec 4, 2019, 5:00:02 AM12/4/19
to Repo and Gerrit Discussion
Also, I can see the difference with the git diff command. When I try upload, it says no changes ready to upload.
Git push, uploaded the changes to gerrit !

 git diff topic_1..master
diff --git a/git.log b/git.log
index b944734..94ebaf9 100644
--- a/git.log
+++ b/git.log
@@ -1,2 +1,4 @@
+1
+2
 3
 4
diff --git a/one b/one
deleted file mode 100644
index 277efe9..0000000
--- a/one
+++ /dev/null
@@ -1 +0,0 @@
-a new file added


repo upload -t --br=master

... A new repo command ( 1.26) is available.
... You should upgrade soon:

    cp /test/.repo/repo/repo /usr/bin/repo

no branches ready for upload

git push training HEAD:refs/for/master
Counting objects: 21, done.
Delta compression using up to 88 threads.
Compressing objects: 100% (6/6), done.
Writing objects: 100% (9/9), 871 bytes | 0 bytes/s, done.
Total 9 (delta 3), reused 0 (delta 0)
remote: Resolving deltas: 100% (3/3)
remote: Processing changes: new: 3, refs: 3, done
remote:
remote: New Changes:
remote:   https://gerrit.xyz.com/193952 Removing junk
remote:   https://gerrit.xyz.com/193953 Removed junk
remote:   https://gerrit.xyz.com/193954 Adding a new file
remote:
 * [new branch]      HEAD -> refs/for/master

David Pursehouse

unread,
Dec 4, 2019, 5:25:31 AM12/4/19
to Raviraj Karasulli, Repo and Gerrit Discussion
Did you run "repo start" ?

 
To unsubscribe, email repo-discuss...@googlegroups.com

More info at http://groups.google.com/group/repo-discuss?hl=en

---
You received this message because you are subscribed to the Google Groups "Repo and Gerrit Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to repo-discuss...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/repo-discuss/d75b52a4-2935-471e-b281-0bb136262715%40googlegroups.com.

Raviraj Karasulli

unread,
Dec 5, 2019, 1:23:43 AM12/5/19
to Repo and Gerrit Discussion
Thanks, that worked.
I missed repo start, I was thinking git branch and git push --set-upstream would be enough.
Reply all
Reply to author
Forward
0 new messages