Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Issue 4542760560361472: Issue 2310 - Handle alternative syntax of Git SSH URLs (Closed)

Created:
April 29, 2015, 5:10 p.m. by kzar
Modified:
April 30, 2015, 6:43 p.m.
Visibility:
Public.

Description

Issue 2310 - Handle alternative syntax of Git SSH URLs

Patch Set 1 #

Total comments: 1

Patch Set 2 : Moved logic into postprocessing function #

Total comments: 2

Patch Set 3 : Moved postprocess_url function into VC abstraction classes. #

Total comments: 8

Patch Set 4 : Avoid looking up postprocess_url function twice. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+16 lines, -3 lines) Patch
M ensure_dependencies.py View 1 2 3 3 chunks +16 lines, -3 lines 0 comments Download

Messages

Total messages: 12
kzar
Patch Set 1
April 29, 2015, 5:11 p.m. (2015-04-29 17:11:55 UTC) #1
Wladimir Palant
http://codereview.adblockplus.org/4542760560361472/diff/5629499534213120/ensure_dependencies.py File ensure_dependencies.py (right): http://codereview.adblockplus.org/4542760560361472/diff/5629499534213120/ensure_dependencies.py#newcode197 ensure_dependencies.py:197: else: This seems to be the wrong place to ...
April 29, 2015, 6:03 p.m. (2015-04-29 18:03:05 UTC) #2
kzar
Patch Set 2 : Moved logic into postprocessing function
April 30, 2015, 12:37 p.m. (2015-04-30 12:37:07 UTC) #3
Sebastian Noack
http://codereview.adblockplus.org/4542760560361472/diff/5724160613416960/ensure_dependencies.py File ensure_dependencies.py (right): http://codereview.adblockplus.org/4542760560361472/diff/5724160613416960/ensure_dependencies.py#newcode180 ensure_dependencies.py:180: if (type == "git" and "@" in url and ...
April 30, 2015, 1:08 p.m. (2015-04-30 13:08:28 UTC) #4
kzar
Patch Set 3 : Moved postprocess_url function into VC abstraction classes. http://codereview.adblockplus.org/4542760560361472/diff/5724160613416960/ensure_dependencies.py File ensure_dependencies.py (right): ...
April 30, 2015, 1:27 p.m. (2015-04-30 13:27:12 UTC) #5
Sebastian Noack
http://codereview.adblockplus.org/4542760560361472/diff/5676830073815040/ensure_dependencies.py File ensure_dependencies.py (right): http://codereview.adblockplus.org/4542760560361472/diff/5676830073815040/ensure_dependencies.py#newcode113 ensure_dependencies.py:113: return "ssh://" + url.replace(":", "/", 1) How does git ...
April 30, 2015, 1:34 p.m. (2015-04-30 13:34:36 UTC) #6
kzar
Patch Set 4 : Avoid looking up postprocess_url function twice. http://codereview.adblockplus.org/4542760560361472/diff/5676830073815040/ensure_dependencies.py File ensure_dependencies.py (right): http://codereview.adblockplus.org/4542760560361472/diff/5676830073815040/ensure_dependencies.py#newcode113 ...
April 30, 2015, 2:45 p.m. (2015-04-30 14:45:29 UTC) #7
Sebastian Noack
LGTM
April 30, 2015, 3:29 p.m. (2015-04-30 15:29:17 UTC) #8
Wladimir Palant
LGTM http://codereview.adblockplus.org/4542760560361472/diff/5676830073815040/ensure_dependencies.py File ensure_dependencies.py (right): http://codereview.adblockplus.org/4542760560361472/diff/5676830073815040/ensure_dependencies.py#newcode199 ensure_dependencies.py:199: root = repo_types[type].postprocess_url(roots[type]) On 2015/04/30 13:34:36, Sebastian Noack ...
April 30, 2015, 3:48 p.m. (2015-04-30 15:48:30 UTC) #9
Sebastian Noack
http://codereview.adblockplus.org/4542760560361472/diff/5676830073815040/ensure_dependencies.py File ensure_dependencies.py (right): http://codereview.adblockplus.org/4542760560361472/diff/5676830073815040/ensure_dependencies.py#newcode199 ensure_dependencies.py:199: root = repo_types[type].postprocess_url(roots[type]) On 2015/04/30 15:48:30, Wladimir Palant wrote: ...
April 30, 2015, 5:58 p.m. (2015-04-30 17:58:28 UTC) #10
Wladimir Palant
http://codereview.adblockplus.org/4542760560361472/diff/5676830073815040/ensure_dependencies.py File ensure_dependencies.py (right): http://codereview.adblockplus.org/4542760560361472/diff/5676830073815040/ensure_dependencies.py#newcode199 ensure_dependencies.py:199: root = repo_types[type].postprocess_url(roots[type]) On 2015/04/30 17:58:28, Sebastian Noack wrote: ...
April 30, 2015, 6:34 p.m. (2015-04-30 18:34:06 UTC) #11
Sebastian Noack
April 30, 2015, 6:43 p.m. (2015-04-30 18:43:31 UTC) #12
http://codereview.adblockplus.org/4542760560361472/diff/5676830073815040/ensu...
File ensure_dependencies.py (right):

http://codereview.adblockplus.org/4542760560361472/diff/5676830073815040/ensu...
ensure_dependencies.py:199: root = repo_types[type].postprocess_url(roots[type])
On 2015/04/30 18:34:07, Wladimir Palant wrote:
> On 2015/04/30 17:58:28, Sebastian Noack wrote:
> > How is caching one variable lookup + one item lookup + another attribute
> lookup
> > into a variable, reducing duplication, questionable?
> 
> If it provides a negligible performance gain while reducing readability and
> consistency with the surrounding code - sure, that's questionable. It's called
> "premature optimization."

I didn't even mention performance. "Don't repeat yourself" is mostly about code
readability ans maintainability. And I don't see how duplicating code helps
there.

Powered by Google App Engine
This is Rietveld