Troubles editing All-Projects

57 views
Skip to first unread message

jiri...@gmail.com

unread,
Mar 4, 2021, 10:38:35 AM3/4/21
to Repo and Gerrit Discussion
Hello,

I wanted to add automerger.config file to All-Projects but I'm confused what is going on here, see below. Can someone lead me how to achieve the goal please.


jura@brnntbjt01x:~/git$ git clone "ssh://gerrit:29418/All-Projects" && scp -p -P 29418 gerrit:hooks/commit-msg "All-Projects/.git/hooks/"
Cloning into 'All-Projects'...
remote: Counting objects: 96, done
remote: Finding sources: 100% (96/96)
remote: Total 96 (delta 4), reused 14 (delta 4)
Receiving objects: 100% (96/96), 26.96 KiB | 1022.00 KiB/s, done.
Resolving deltas: 100% (4/4), done.
Note: switching to 'bca45e5ab5c7af81837286d436c3b2450c463e70'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by switching back to a branch.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -c with the switch command. Example:

  git switch -c <new-branch-name>

Or undo this operation with:

  git switch -

Turn off this advice by setting config variable advice.detachedHead to false

commit-msg                                                                                                                                                                                                                                              100% 1790   151.7KB/s   00:00    
jura@brnntbjt01x:~/git$ cd All-Projects/
jura@brnntbjt01x:~/git/All-Projects$
jura@brnntbjt01x:~/git/All-Projects$
jura@brnntbjt01x:~/git/All-Projects$ git fetch refs/meta/config
fatal: 'refs/meta/config' does not appear to be a git repository
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
jura@brnntbjt01x:~/git/All-Projects$ git fetch origin refs/meta/config
From ssh://gerrit:29418/All-Projects
 * branch            refs/meta/config -> FETCH_HEAD
jura@brnntbjt01x:~/git/All-Projects$
jura@brnntbjt01x:~/git/All-Projects$ git status
Not currently on any branch.
nothing to commit, working tree clean
jura@brnntbjt01x:~/git/All-Projects$ git checkout refs/meta/config
error: pathspec 'refs/meta/config' did not match any file(s) known to git
jura@brnntbjt01x:~/git/All-Projects$
jura@brnntbjt01x:~/git/All-Projects$ git branch -r
  origin/meta/config
jura@brnntbjt01x:~/git/All-Projects$
jura@brnntbjt01x:~/git/All-Projects$ git checkout origin/meta/config
Warning: you are leaving 21 commits behind, not connected to
any of your branches:

  bca45e5 Modify access rules
  fe93179 Modify access rules
  fd0c700 Modify access rules
  cdd9650 Modify access rules
 ... and 17 more.

If you want to keep them by creating a new branch, this may be a good time
to do so with:

 git branch <new-branch-name> bca45e5

HEAD is now at 90d00dc added forgeAuthor and forgeCommiter for tags

Matthias Sohn

unread,
Mar 4, 2021, 11:41:58 AM3/4/21
to jiri...@gmail.com, Repo and Gerrit Discussion
try this (refs/meta/config is not a branch but a custom ref, you need to specify on which branch the commits
of this ref should end up in your clone):

git fetch origin refs/meta/config:config

modify file
git add <modified files>
git. commit
git push origin HEAD:refs/meta/config

or if you want to review the changes:

git push origin HEAD:refs/for/refs/meta/config
 
--
--
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/39dedc55-4a3c-46e6-8c87-5ef3d69a35dbn%40googlegroups.com.

Matthias Sohn

unread,
Mar 4, 2021, 11:42:40 AM3/4/21
to jiri...@gmail.com, Repo and Gerrit Discussion
here I missed

git checkout config

Jonathan Nieder

unread,
Mar 4, 2021, 11:45:39 AM3/4/21
to Matthias Sohn, jiri...@gmail.com, Repo and Gerrit Discussion
Matthias's description is good. The main other thing I'd add is that https://gerrit-review.googlesource.com/Documentation/user-notify.html#project shows an example.

Arguably that example should be moved somewhere easier to find, such as a new page devoted specifically to refs/meta/config. Feel free to file a bug for this at https://crbug.com/gerrit/new if you agree.

Thanks,
Jonathan

jiri...@gmail.com

unread,
Mar 5, 2021, 5:02:04 AM3/5/21
to Repo and Gerrit Discussion
Thanks @Matthias to pointing me the right direction.
Reply all
Reply to author
Forward
0 new messages