Preview Markdown Changes with Gerrit

1,493 views
Skip to first unread message

Andrew Grieve

unread,
May 10, 2017, 3:31:27 PM5/10/17
to chromium-dev
One neat bonus of using the new code-review tool is that you can include links to rendered markdown changes.

1. Use new code review via:
git config --local gerrit.host true

2. Upload your change. It will show a message like:
 * [new branch]                GIT_HASH -> refs/for/refs/heads/master%m=0x1f412,notify=NONE

3. Craft link like:

Scott Graham

unread,
May 10, 2017, 3:45:45 PM5/10/17
to Andrew Grieve, chromium-dev
Just be aware of where you're uploading the doc. I thought I was being clever doing this too, and I ended up repeatedly spamming lots of auto-CC'd people because of Gerrit's apparent enthusiasm for sending emails every time something in its data store changes.

(Nice feature to have though!)

--
--
Chromium Developers mailing list: chromi...@chromium.org
View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-dev
---
You received this message because you are subscribed to the Google Groups "Chromium-dev" group.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-dev/CABiQX1VOJcO3m8%3DAkUwzUEnHzwTRkvZUMvYSusVR53NzugmgNQ%40mail.gmail.com.

Mike Frysinger

unread,
May 10, 2017, 3:52:13 PM5/10/17
to Andrew Grieve, chromium-dev
there is a md_browser tool meant for local rendering/testing:

it doesn't match gitiles's markdown exactly, but it should be good enough for most work.  the review tool doesn't matter either.

if your repo supports sandboxes, you could always push that way.  for example, in many CrOS repos, you can do:
  $ git push --force origin HEAD:refs/sandbox/$USER/foo
then browse to:
  https://chromium.googlesource.com/<repo>/+/sandbox/$USER/foo/

this avoids spamming gerrit with lots of patchsets.
-mike

--

Dirk Pranke

unread,
May 10, 2017, 3:56:18 PM5/10/17
to Andrew Grieve, chromium-dev
You don't actually have to craft the URL by hand, either. If you click on the review link for a particular file in your CL, there's a link to view the file in gitiles:


-- Dirk


--

agable

unread,
May 10, 2017, 5:28:14 PM5/10/17
to Chromium-dev, agr...@chromium.org
Another way to get there:
Load the main page for the review (e.g. by following the link that git-cl-upload prints), then click on the hash of the commit you uploaded, then on the file you want to see.

Mark Mentovai

unread,
May 10, 2017, 5:41:40 PM5/10/17
to Mike Frysinger, Andrew Grieve, chromium-dev
Another tip for enhanced stealth: I found that it actually didn’t take very much effort to set up a local Gitiles instance.

natiq alkarakole

unread,
May 14, 2017, 9:18:33 PM5/14/17
to vap...@chromium.org, Andrew Grieve, chromium-dev
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-dev...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-dev/CAAbOSckuSdADBHCUJBF%3D3iTSdaFasxC8Zzt9sze-hX1i6ZMhTA%40mail.gmail.com.
Reply all
Reply to author
Forward
0 new messages