* [PATCH 0/3] Comment style fixes
@ 2024-01-29 20:28 Junio C Hamano
2024-01-29 20:28 ` [PATCH 1/3] builtin/worktree: comment " Junio C Hamano
` (3 more replies)
0 siblings, 4 replies; 5+ messages in thread
From: Junio C Hamano @ 2024-01-29 20:28 UTC (permalink / raw
To: git
Among comments in the traditional /* single liner */ ones, our
reviews seem to have missed a few // comments. While they are not
illegal per-se, they look out of place mixed with the /* ... */
style comments, which is the prevailing style used in this project.
Fix those small number of style violations in our own code; files
with borrowed code that have // comments as the prevalent style are
left untouched.
Junio C Hamano (3):
builtin/worktree: comment style fixes
merge-ort.c: comment style fix
reftable/pq_test: comment style fix
builtin/worktree.c | 10 +++++-----
merge-ort.c | 2 +-
reftable/pq_test.c | 2 +-
3 files changed, 7 insertions(+), 7 deletions(-)
--
2.43.0-440-gb50a608ba2
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH 1/3] builtin/worktree: comment style fixes
2024-01-29 20:28 [PATCH 0/3] Comment style fixes Junio C Hamano
@ 2024-01-29 20:28 ` Junio C Hamano
2024-01-29 20:28 ` [PATCH 2/3] merge-ort.c: comment style fix Junio C Hamano
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: Junio C Hamano @ 2024-01-29 20:28 UTC (permalink / raw
To: git
Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
builtin/worktree.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/builtin/worktree.c b/builtin/worktree.c
index 6d7da11746..9c76b62b02 100644
--- a/builtin/worktree.c
+++ b/builtin/worktree.c
@@ -848,21 +848,21 @@ static int add(int ac, const char **av, const char *prefix)
const char *s = worktree_basename(path, &n);
new_branch = xstrndup(s, n);
} else if (opts.orphan) {
- // No-op
+ ; /* no-op */
} else if (opts.detach) {
- // Check HEAD
+ /* Check HEAD */
if (!strcmp(branch, "HEAD"))
can_use_local_refs(&opts);
} else if (ac < 2 && new_branch) {
- // DWIM: Infer --orphan when repo has no refs.
+ /* DWIM: Infer --orphan when repo has no refs. */
opts.orphan = dwim_orphan(&opts, !!opt_track, 0);
} else if (ac < 2) {
- // DWIM: Guess branch name from path.
+ /* DWIM: Guess branch name from path. */
const char *s = dwim_branch(path, &new_branch);
if (s)
branch = s;
- // DWIM: Infer --orphan when repo has no refs.
+ /* DWIM: Infer --orphan when repo has no refs. */
opts.orphan = (!s) && dwim_orphan(&opts, !!opt_track, 1);
} else if (ac == 2) {
struct object_id oid;
--
2.43.0-440-gb50a608ba2
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH 2/3] merge-ort.c: comment style fix
2024-01-29 20:28 [PATCH 0/3] Comment style fixes Junio C Hamano
2024-01-29 20:28 ` [PATCH 1/3] builtin/worktree: comment " Junio C Hamano
@ 2024-01-29 20:28 ` Junio C Hamano
2024-01-29 20:28 ` [PATCH 3/3] reftable/pq_test: " Junio C Hamano
2024-01-30 6:10 ` [PATCH 0/3] Comment style fixes Patrick Steinhardt
3 siblings, 0 replies; 5+ messages in thread
From: Junio C Hamano @ 2024-01-29 20:28 UTC (permalink / raw
To: git
Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
merge-ort.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/merge-ort.c b/merge-ort.c
index 77ba7f3020..cb83449d7f 100644
--- a/merge-ort.c
+++ b/merge-ort.c
@@ -2641,7 +2641,7 @@ static void apply_directory_rename_modifications(struct merge_options *opt,
oidcpy(&ci->stages[i].oid, null_oid());
}
- // Now we want to focus on new_ci, so reassign ci to it
+ /* Now we want to focus on new_ci, so reassign ci to it. */
ci = new_ci;
}
--
2.43.0-440-gb50a608ba2
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH 3/3] reftable/pq_test: comment style fix
2024-01-29 20:28 [PATCH 0/3] Comment style fixes Junio C Hamano
2024-01-29 20:28 ` [PATCH 1/3] builtin/worktree: comment " Junio C Hamano
2024-01-29 20:28 ` [PATCH 2/3] merge-ort.c: comment style fix Junio C Hamano
@ 2024-01-29 20:28 ` Junio C Hamano
2024-01-30 6:10 ` [PATCH 0/3] Comment style fixes Patrick Steinhardt
3 siblings, 0 replies; 5+ messages in thread
From: Junio C Hamano @ 2024-01-29 20:28 UTC (permalink / raw
To: git
Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
reftable/pq_test.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/reftable/pq_test.c b/reftable/pq_test.c
index 011b5c7502..c202eff848 100644
--- a/reftable/pq_test.c
+++ b/reftable/pq_test.c
@@ -60,7 +60,7 @@ static void test_pq(void)
if (last) {
EXPECT(strcmp(last, rec->u.ref.refname) < 0);
}
- // this is names[i], so don't dealloc.
+ /* this is names[i], so don't dealloc. */
last = rec->u.ref.refname;
rec->u.ref.refname = NULL;
reftable_record_release(rec);
--
2.43.0-440-gb50a608ba2
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH 0/3] Comment style fixes
2024-01-29 20:28 [PATCH 0/3] Comment style fixes Junio C Hamano
` (2 preceding siblings ...)
2024-01-29 20:28 ` [PATCH 3/3] reftable/pq_test: " Junio C Hamano
@ 2024-01-30 6:10 ` Patrick Steinhardt
3 siblings, 0 replies; 5+ messages in thread
From: Patrick Steinhardt @ 2024-01-30 6:10 UTC (permalink / raw
To: Junio C Hamano; +Cc: git
[-- Attachment #1: Type: text/plain, Size: 565 bytes --]
On Mon, Jan 29, 2024 at 12:28:36PM -0800, Junio C Hamano wrote:
> Among comments in the traditional /* single liner */ ones, our
> reviews seem to have missed a few // comments. While they are not
> illegal per-se, they look out of place mixed with the /* ... */
> style comments, which is the prevailing style used in this project.
>
> Fix those small number of style violations in our own code; files
> with borrowed code that have // comments as the prevalent style are
> left untouched.
These changes look obviously good to me, thanks!
Patrick
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2024-01-30 6:10 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-01-29 20:28 [PATCH 0/3] Comment style fixes Junio C Hamano
2024-01-29 20:28 ` [PATCH 1/3] builtin/worktree: comment " Junio C Hamano
2024-01-29 20:28 ` [PATCH 2/3] merge-ort.c: comment style fix Junio C Hamano
2024-01-29 20:28 ` [PATCH 3/3] reftable/pq_test: " Junio C Hamano
2024-01-30 6:10 ` [PATCH 0/3] Comment style fixes Patrick Steinhardt
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).