Skip to contentSkip to conversation

read-cache: fix indentation in read_index_from

PATCH In review Stefan Beller 2 participants 4 messages Jun 15, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 read-cache: fix indentation in read_index_from

---
 read-cache.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
read-cache.c +1 -1
index 89dbc08..a3df665 100644
@@ -1653,7 +1653,7 @@ int read_index_from(struct index_state *istate, const char *path)
 		die("broken index, expect %s in %s, got %s",
 		    sha1_to_hex(split_index->base_sha1),
 		    git_path("sharedindex.%s",
-				     sha1_to_hex(split_index->base_sha1)),
+			     sha1_to_hex(split_index->base_sha1)),
 		    sha1_to_hex(split_index->base->sha1));
 	merge_base_index(istate);
 	check_ce_order(istate);
Signature · 1 line
2.5.0.264.geed6e44.dirty
#1 lore raw
Quoted 10 lines · Stefan Beller
---
 read-cache.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
read-cache.c +0 -0
index 89dbc08..a3df665 100644

read-cache.c int read_index_from(struct index_state *istate, const char *path) · line 1656

Quoted 5 lines
read-cache.c +1 -1
@@ -1653,7 +1653,7 @@ int read_index_from(struct index_state *istate, const char *path)
 		die("broken index, expect %s in %s, got %s",
 		    sha1_to_hex(split_index->base_sha1),
 		    git_path("sharedindex.%s",
-				     sha1_to_hex(split_index->base_sha1)),
+			     sha1_to_hex(split_index->base_sha1)),

We allow two styles in our codebase, (1) indent to align with opening parenthesis, or (2) indent sufficiently deeper than the first line with HT. The original is neither, so in that sense it is a good thing to do in the long run.

I'll queue it for this time, but in general, I'd prefer if people refrained from touching code only for style fixes in an area that is touched actively in topics, unless it is done inside a topic that has to touch that area of the code in order to do something more than style fixes.

Thanks.

Quoted 3 lines
read-cache.c +0 -0
 		    sha1_to_hex(split_index->base->sha1));
 	merge_base_index(istate);
 	check_ce_order(istate);
#2 lore raw
Quoted 23 lines · Junio C Hamano
Quoted 10 lines · Stefan Beller
---
 read-cache.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
read-cache.c +0 -0
index 89dbc08..a3df665 100644

read-cache.c int read_index_from(struct index_state *istate, const char *path) · line 1656

Quoted 5 lines
read-cache.c +1 -1
@@ -1653,7 +1653,7 @@ int read_index_from(struct index_state *istate, const char *path)
              die("broken index, expect %s in %s, got %s",
                  sha1_to_hex(split_index->base_sha1),
                  git_path("sharedindex.%s",
-                                  sha1_to_hex(split_index->base_sha1)),
+                          sha1_to_hex(split_index->base_sha1)),

We allow two styles in our codebase, (1) indent to align with opening parenthesis, or (2) indent sufficiently deeper than the first line with HT. The original is neither, so in that sense it is a good thing to do in the long run.

Quoted 5 lines

I'll queue it for this time, but in general, I'd prefer if people refrained from touching code only for style fixes in an area that is touched actively in topics, unless it is done inside a topic that has to touch that area of the code in order to do something more than style fixes.

Right. :(

The problem here is that I was looking to use read_index_from in the submodule code to implement recursive actions, but as I could not find documentation on how to use it, I read the code. And whenever I see obvious things to fix (such as style), I cannot stop myself from shooting from the hip, sending a patch. I'll stop doing that.

Quoted 6 lines

Thanks.

Quoted 3 lines
read-cache.c +0 -0
                  sha1_to_hex(split_index->base->sha1));
      merge_base_index(istate);
      check_ce_order(istate);
#3 lore raw
Quoted 6 lines · Stefan Beller
Quoted 5 lines

I'll queue it for this time, but in general, I'd prefer if people refrained from touching code only for style fixes in an area that is touched actively in topics, unless it is done inside a topic that has to touch that area of the code in order to do something more than style fixes.

Quoted 8 lines

Right. :(

The problem here is that I was looking to use read_index_from in the submodule code to implement recursive actions, but as I could not find documentation on how to use it, I read the code. And whenever I see obvious things to fix (such as style), I cannot stop myself from shooting from the hip, sending a patch. I'll stop doing that.

Don't stop; instead queue and keep them on your own queue, so that you can find a good time to send them out.

A good rule-of-thumb for "good time" is when "git diff maint pu" does not show any overlap to the context and preimage of your patches.

Thanks.