Thread (4 messages) 4 messages, 2 authors, 2016-06-15

Re: [PATCH 2/2] Improve the naming of guessed target repository for git clone

From: Alex Riesen <hidden>
Date: 2016-06-15 22:46:46

Possibly related (same subject, not in this thread)

2009/5/14 Junio C Hamano [off-list ref]:
Alex Riesen [off-list ref] writes:
quoted
+     /* replace all 'control' characters with ascii space */
+     for (start = dir; *start; ++start)
+             if (*(const unsigned char *)start < 32u)
+                     dir[start - dir] = '\x20';
What's this strange mixture of 32u and '\x20'?
Not sure myself. I probably wanted visibility, and somehow ended
up using different presentations.
quoted
+     /* remove trailing spaces */
+     if (dir < start)
+             for (end = start; dir < --end; )
+                     if (!isspace(*end))
+                             break;
+                     else
+                             dir[end - dir] = '\0';
+     return dir;
 }
Honestly, I regret having asked if there was a 2/2 ;-)

What's the point of this change, now that you have a fix in 1/2?  Who are
you helping with this patch?
Without this the _automatically_ generated names for cloned repositories
have all the whitespace around them. As you cannot sanely depend on
automatically
generated names, I thought that making them simpler will make sense.

But I should complete the patch: remove heading whitespace, and replace
multiple spaces and control characters with one space.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help