Git development
 help / color / mirror / Atom feed
* Re: Is --minimal ever not the right thing?
From: Mike Castle @ 2023-12-19 17:25 UTC (permalink / raw)
  To: Tao Klerks; +Cc: git
In-Reply-To: <CAPMMpohbQK+3o46iiY+0o=vS+UC_HBB=CxsNT_hAb5dDz+514Q@mail.gmail.com>

I believe that the diff algorithms available are the same one's in GNU
diff.  From https://www.gnu.org/software/diffutils/manual/html_node/diff-Performance.html:
"""
The way that GNU diff determines which lines have changed always comes
up with a near-minimal set of differences. Usually it is good enough
for practical purposes. If the diff output is large, you might want
diff to use a modified algorithm that sometimes produces a smaller set
of differences. The --minimal (-d) option does this; however, it can
also cause diff to run more slowly than usual, so it is not the
default behavior.
"""

Since it has been that way decades before git even existed, I suspect
(but do not know) that, yes, analysis has been performed, and it makes
sense to keep the current default.

Then again, in the decades sense, the entire stack from hardware to
compilers has improved, and maybe it does deserve a revisit.  You
could check whatever email archives is used for diffutils and see if
there has been any discussion on it recently (say, last 5 years?).

As you pointed out, you can set it yourself and see what happens over time.

Cheers,
mrc

^ permalink raw reply

* Re: [PATCH] rebase: use strvec_pushf() for format-patch revisions
From: Junio C Hamano @ 2023-12-19 17:12 UTC (permalink / raw)
  To: René Scharfe; +Cc: Git List
In-Reply-To: <4ab7431c-6c1b-448c-b4d2-e8b9be0e4eef@web.de>

René Scharfe <l.s.r@web.de> writes:

> In run_am(), a strbuf is used to create a revision argument that is then
> added to the argument list for git format-patch using strvec_push().
> Use strvec_pushf() to add it directly instead, simplifying the code.
>
> Signed-off-by: René Scharfe <l.s.r@web.de>
> ---

Makes sense.  Between the location of the original strbuf_addf()
call and the new strvec_pushf() call, nobody mucks with *opts so
this change won't affect the correctness.  We no longer use the
extra strbuf, and upon failing to open the rebased-patches file,
we no longer leak the contents of it.  Good.

> @@ -615,34 +614,32 @@ static int run_am(struct rebase_options *opts)
>  		return run_command(&am);
>  	}
>
> -	strbuf_addf(&revisions, "%s...%s",
> -		    oid_to_hex(opts->root ?
> -			       /* this is now equivalent to !opts->upstream */
> -			       &opts->onto->object.oid :
> -			       &opts->upstream->object.oid),
> -		    oid_to_hex(&opts->orig_head->object.oid));
> -
>  	rebased_patches = xstrdup(git_path("rebased-patches"));
>  	format_patch.out = open(rebased_patches,
>  				O_WRONLY | O_CREAT | O_TRUNC, 0666);
>  	if (format_patch.out < 0) {
>  		status = error_errno(_("could not open '%s' for writing"),
>  				     rebased_patches);
>  		free(rebased_patches);
>  		strvec_clear(&am.args);
>  		return status;
>  	}
>
>  	format_patch.git_cmd = 1;
>  	strvec_pushl(&format_patch.args, "format-patch", "-k", "--stdout",
>  		     "--full-index", "--cherry-pick", "--right-only",
>  		     "--default-prefix", "--no-renames",
>  		     "--no-cover-letter", "--pretty=mboxrd", "--topo-order",
>  		     "--no-base", NULL);
>  	if (opts->git_format_patch_opt.len)
>  		strvec_split(&format_patch.args,
>  			     opts->git_format_patch_opt.buf);
> -	strvec_push(&format_patch.args, revisions.buf);
> +	strvec_pushf(&format_patch.args, "%s...%s",
> +		     oid_to_hex(opts->root ?
> +				/* this is now equivalent to !opts->upstream */
> +				&opts->onto->object.oid :
> +				&opts->upstream->object.oid),
> +		     oid_to_hex(&opts->orig_head->object.oid));
>  	if (opts->restrict_revision)
>  		strvec_pushf(&format_patch.args, "^%s",
>  			     oid_to_hex(&opts->restrict_revision->object.oid));
> @@ -665,10 +662,8 @@ static int run_am(struct rebase_options *opts)
>  			"As a result, git cannot rebase them."),
>  		      opts->revisions);
>
> -		strbuf_release(&revisions);
>  		return status;
>  	}
> -	strbuf_release(&revisions);
>
>  	am.in = open(rebased_patches, O_RDONLY);
>  	if (am.in < 0) {
> --
> 2.43.0

^ permalink raw reply

* Re: [PATCH] Teach git apply to respect core.fileMode settings
From: Chandra Pratap @ 2023-12-19 17:07 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Chandra Pratap via GitGitGadget, git
In-Reply-To: <xmqqbkanfkjy.fsf@gitster.g>

Thanks for the review, Junio. I have considered your feedback and
will adjust the patch as such. The mail formatting issues seem to
have arisen from my invigilant use of GitGitGadget.

> Junio C Hamano <gitster@pobox.com> writes:
>
> IOW, I am wondering if the above should look more like
>
>        if (!state->cached && !previous) {
>                if (!trust_executable_bit) {
>                        if (*ce)
>                                st_mode = (*ce)->ce_mode;
>                        else
>                                st_mode = patch->old_mode;
>                } else {
>                       st_mode = ce_mode_from_stat(*ce, st->st_mode);
>                }
>      }

You're right, we should prioritise the file mode info from the
existing cache entry (if one exists) instead of blindly assigning
the one from the incoming patch. It's more robust that way.

> Perhaps we would want to check with "git ls-files -s script.sh" what
> its mode bits are (hopefully it would be executable).
>
> Similarly, check with "git ls-tree -r HEAD script.sh" what its mode>
> bits are?
>
> Check that the patch expects script.sh to have its executable bit
> here, too?

I assume we're doing all this filemode checking to ensure that the
executable bit doesn't get lost due to any other git command?

> The code change in this patch is primarily about making the code
> work better for folks without trustworthy filemode support.
> Emulating what happens by setting core.fileMode to false on a
> platform with capable filesystems may be a way to test the code, but
> we should have a test specific to folks without FILEMODE
> prerequisites and make sure it works well, no?
>
> IOW, shouldn't we drom FILEMODE prerequisite from this test?

I will keep that in mind.

^ permalink raw reply

* git diff-files bug
From: Josh Reed @ 2023-12-19 16:53 UTC (permalink / raw)
  To: git

Thank you for filling out a Git bug report!
Please answer the following questions to help us understand your issue.

What did you do before the bug happened? (Steps to reproduce your issue)

> bash
⬢[jreed@toolbox example-project]$ git diff-files --exit-code --patch; echo $?
0
⬢[jreed@toolbox example-project]$ chmod g+w README.md
⬢[jreed@toolbox example-project]$ git diff-files --exit-code --patch; echo $?
1
⬢[jreed@toolbox example-project]$ git diff --exit-code --patch; echo $?
0
⬢[jreed@toolbox example-project]$ git diff-files --exit-code --patch; echo $?
0


What did you expect to happen? (Expected behavior)

Git diff-files should likely ignore group permissions changes, or at least
its output should be stable across the same worktree/index state.

What happened instead? (Actual behavior)

The command `git diff-files --exit-code --patch` fails with no exit code when
a file mode has changed in a way that the rest of git commands ignored.
Furthermore, subsequent git commands seem to change the behavior of `git
diff-files` in this regard, so it's hard to tell what is the expected behavior.

What's different between what you expected and what actually happened?

The `git diff-files --exit-code` command is inconsistent in how it behaves.
I suspect it should ignore irrelavant mode changes like `g+w`, but even if
it should report them, they should produce a patch or at least have stable
results when we re-run the command.

Anything else you want to add:

Please review the rest of the bug report below.
You can delete any lines you don't wish to share.


[System Info]
git version:
git version 2.41.0
cpu: x86_64
no commit associated with this build
sizeof-long: 8
sizeof-size_t: 8
shell-path: /bin/sh
uname: Linux 6.5.10-200.fc38.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Nov  2
19:59:55 UTC 2023 x86_64
compiler info: gnuc: 13.1
libc info: glibc: 2.37
$SHELL (typically, interactive shell): /usr/bin/fish


[Enabled Hooks]
pre-commit
pre-push

^ permalink raw reply

* Re: [PATCH 2/1] test-lib-functions: add object size functions
From: René Scharfe @ 2023-12-19 16:42 UTC (permalink / raw)
  To: Jeff King; +Cc: git, Ondrej Pohorelsky, brian m . carlson, Junio C Hamano
In-Reply-To: <20231214205936.GA2272813@coredump.intra.peff.net>

Am 14.12.23 um 21:59 schrieb Jeff King:
> On Wed, Dec 13, 2023 at 01:28:56PM +0100, René Scharfe wrote:
>
>> Add test_object_size and its helpers test_loose_object_size and
>> test_packed_object_size, which allow determining the size of a Git
>> object using only the low-level Git commands rev-parse and show-index.
>>
>> Use it in t6300 to replace the bare-bones function test_object_file_size
>> as a motivating example.  There it provides the expected output of the
>> high-level Git command for-each-ref.
>
> This adds a packed-object function, but I doubt anybody actually calls
> it. If we're going to do that, it's probably worth adding some tests for
> "cat-file --batch-check" or similar.

Yes, and I was assuming that someone else would be eager to add such
tests. *ahem*

> At which point I wonder if rather than having a function for a single
> object, we are better off just testing the result of:
>
>   git cat-file --batch-all-objects --unordered --batch-check='%(objectsize:disk)'
>
> against a single post-processed "show-index" invocation.

Sure, we might want to optimize for bulk-processing and possibly end up
only checking the size of single objects in t6300, making new library
functions unnecessary.

When dumping size information of multiple objects, it's probably a good
idea to include "%(objectname)" as well in the format.

You'd need one show-index call for each .idx file.  A simple test would
only have a single one; a library function might need to handle multiple
packs.

>> So how about this?  I'm a bit nervous about all the rules about output
>> descriptors and error propagation and whatnot in the test library, but
>> this implementation seems simple enough and might be useful in more than
>> one test.  No idea how to add support for alternate object directories,
>> but I doubt we'll ever need it.
>
> I'm not sure that we need to do anything special with output
> redirection. Shouldn't these functions just send errors to stderr as
> usual? If they are run inside a test_expect block, that goes to
> descriptor 4 (which is either /dev/null or the original stderr,
> depending on whether "-v" was used).

Good point.  My bad excuse is that I copied the redirection to fd 4 from
test_grep.

>> +	git show-index <"$idx" |
>> +	awk -v oid="$oid" -v end="$end" '
>> +		$2 == oid {start = $1}
>> +		{offsets[$1] = 1}
>> +		END {
>> +			if (!start || start >= end)
>> +				exit 1
>> +			for (o in offsets)
>> +				if (start < o && o < end)
>> +					end = o
>> +			print end - start
>> +		}
>> +	' && return 0
>
> I was confused at first, because I didn't see any sorting happening. But
> if I understand correctly, you're just looking for the smallest "end"
> that comes after the start of the object we're looking for. Which I
> think works.

Yes, calculating the minimum offset suffices when handling a single
object -- no sorting required.  For bulk mode we'd better sort, of
course:

	git show-index <"$idx" |
	sort -n |
	awk -v end="$end" '
		NR > 1 {print oid, $1 - start}
		{start = $1; oid = $2}
		END {print oid, end - start}
	'

No idea how to make such a thing robust against malformed or truncated
output from show-index, but perhaps that's not necessary, depending on
how the result is used.

René


^ permalink raw reply

* Re: What's cooking in git.git (Dec 2023, #03; Mon, 18)
From: René Scharfe @ 2023-12-19 16:42 UTC (permalink / raw)
  To: Junio C Hamano, git
In-Reply-To: <xmqqr0jjc86e.fsf@gitster.g>

Am 19.12.23 um 02:06 schrieb Junio C Hamano:
> * rs/t6300-compressed-size-fix (2023-12-13) 2 commits
>  - test-lib-functions: add object size functions
>  - t6300: avoid hard-coding object sizes
>
>  Test fix.
>
>  Will merge to 'next'?
>  source: <9feeb6cf-aabf-4002-917f-3f6c27547bc8@web.de>
>  source: <ff735aac-b60b-4d52-a6dc-180ab504fc8d@web.de>

The first patch is good to go.  The seconds one isn't; please drop it.

René


^ permalink raw reply

* Is --minimal ever not the right thing?
From: Tao Klerks @ 2023-12-19 16:10 UTC (permalink / raw)
  To: git

Hi folks,

A user today showed me a situation where `git diff` (and `git blame`)
seemed to be doing the wrong thing: where two big blocks of text were
removed from a file, leaving 4 lines untouched in the middle, the
default diff was noting all three regions as lines removed, with those
4 "untouched" lines as *added* in the same place.

We compared to another diffing tool, p4merge, and that was showing
"the right thing" - two deleted regions with untouched lines in the
middle.

We realized that `--minimal` does "the right thing" in git, and you
can set up `diff.algorithm` config to use it by default in `git diff`
(although `git blame` doesn't currently/yet support it... a small
enhancement opportunity there :) ), but that raises two questions:

1. Is there any practical reason for any user *not* to set
`diff.algorithm` to `minimal`? Has anyone ever done an analysis of the
performance cost (or "diff readability cost", if that is a thing) of
"minimal" vs "default"?

2. If "minimal" is just better, and its higher computational cost is
effectively trivial, then why wouldn't we change the default?

I suspect this comes down to situations where git does big diffs
behind the scenes...? But I don't know offhand.

Any feedback would be most appreciated!

Thanks,
Tao

^ permalink raw reply

* Re: [PATCH] doc: format.notes specify a ref under refs/notes/ hierarchy
From: Jiang Xin @ 2023-12-19 15:33 UTC (permalink / raw)
  To: Junio C Hamano, Teng Long, Jean-Noël Avila, Peter Pan
  Cc: Patrick Steinhardt, git, Ramsay Jones
In-Reply-To: <xmqq1qbjij0f.fsf@gitster.g>

On Tue, Dec 19, 2023 at 12:16 AM Junio C Hamano <gitster@pobox.com> wrote:
>
> Patrick Steinhardt <ps@pks.im> writes:
> > the translation changes with a big grain of salt though,
>
> Hopefully pinging Jiang would be sufficient to ask help from the
> French, Chinese, and Taiwaneese translation teams.

The l10n team has a command line tool called git-po-helper that can
check for spelling errors in translations, such as mismatched command
names, configuration variables. A new pattern will be added to find
mismatched reference prefixes, and the following typos will be fixed
during the next localization window.

> > diff --git a/po/fr.po b/po/fr.po
> > index ee2e610ef1..744550b056 100644
> > --- a/po/fr.po
> > +++ b/po/fr.po
> > @@ -19773,7 +19773,7 @@ msgid ""
> >  "Neither worked, so we gave up. You must fully qualify the ref."
> >  msgstr ""
> >  "La destination que vous avez fournie n'est pas un nom de référence complète\n"
> > -"(c'est-à-dire commençant par \"ref/\"). Essai d'approximation par :\n"
> > +"(c'est-à-dire commençant par \"refs/\"). Essai d'approximation par :\n"
> >  "\n"
> >  "- Recherche d'une référence qui correspond à '%s' sur le serveur distant.\n"
> >  "- Vérification si la <source> en cours de poussée ('%s')\n"
> > diff --git a/po/zh_CN.po b/po/zh_CN.po
> > index 86402725b2..eb47e8f9b7 100644
> > --- a/po/zh_CN.po
> > +++ b/po/zh_CN.po
> > @@ -13224,8 +13224,8 @@ msgid ""
> >  msgid_plural ""
> >  "Note: Some branches outside the refs/remotes/ hierarchy were not removed;\n"
> >  "to delete them, use:"
> > -msgstr[0] "注意:ref/remotes 层级之外的一个分支未被移除。要删除它,使用:"
> > -msgstr[1] "注意:ref/remotes 层级之外的一些分支未被移除。要删除它们,使用:"
> > +msgstr[0] "注意:refs/remotes 层级之外的一个分支未被移除。要删除它,使用:"
> > +msgstr[1] "注意:refs/remotes 层级之外的一些分支未被移除。要删除它们,使用:"
> >
> >  #: builtin/remote.c
> >  #, c-format
> > diff --git a/po/zh_TW.po b/po/zh_TW.po
> > index f777a0596f..b2a79cdd93 100644
> > --- a/po/zh_TW.po
> > +++ b/po/zh_TW.po
> > @@ -13109,7 +13109,7 @@ msgid ""
> >  msgid_plural ""
> >  "Note: Some branches outside the refs/remotes/ hierarchy were not removed;\n"
> >  "to delete them, use:"
> > -msgstr[0] "注意:ref/remotes 層級之外的一個分支未被移除。要刪除它,使用:"
> > +msgstr[0] "注意:refs/remotes 層級之外的一個分支未被移除。要刪除它,使用:"
> >
> >  #: builtin/remote.c
> >  #, c-format

^ permalink raw reply

* Re: [PATCH 6/8] SubmittingPatches: clarify GitHub visual
From: René Scharfe @ 2023-12-19 14:44 UTC (permalink / raw)
  To: Josh Soref via GitGitGadget, git; +Cc: Elijah Newren, Josh Soref
In-Reply-To: <043d2a24202d39c5564e4a4369c86ae4648dd721.1702975320.git.gitgitgadget@gmail.com>

Am 19.12.23 um 09:41 schrieb Josh Soref via GitGitGadget:
> From: Josh Soref <jsoref@gmail.com>
>
> Some people would expect a cross to be upright, and potentially have
> unequal lengths...

There are lots of types of crosses.  And while looking them up on
Wikipedia I learned today that an x-cross is called "saltire" in
English.  I only knew it as St. Andrew's cross before.

> GitHub uses a white x overlaying a solid red circle to indicate failure.

They call it "x-circle-fill"
(https://primer.github.io/octicons/x-circle-fill-16).

>
> Signed-off-by: Josh Soref <jsoref@gmail.com>
> ---
>  Documentation/SubmittingPatches | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/Documentation/SubmittingPatches b/Documentation/SubmittingPatches
> index d7a84f59478..8e19c7f82e4 100644
> --- a/Documentation/SubmittingPatches
> +++ b/Documentation/SubmittingPatches
> @@ -604,7 +604,7 @@ to your fork of Git on GitHub.  You can monitor the test state of all your
>  branches here: `https://github.com/<Your GitHub handle>/git/actions/workflows/main.yml`
>
>  If a branch did not pass all test cases then it is marked with a red
> -cross. In that case you can click on the failing job and navigate to
> ++x+. In that case you can click on the failing job and navigate to

In the commit message you say the x is white, here it's red, so what is
it?  IIUC the circle is red and the x-cross inside is the same color as
the background, i.e. white in light mode and black in dark mode.  No
idea how to express that in one word.  Perhaps "red circle containing
and x-cross"?

René


^ permalink raw reply

* Problem with commit-graph verify
From: Anton Sergeev @ 2023-12-19 13:39 UTC (permalink / raw)
  To: git

Hi folks,

I have a problem with 'commit-graph verify' in poco repository ([1]).
A commit appeared there with an odd timestamp and time zone ([2]):

     git show --no-patch --pretty=%ai 
381ac1d9a82c9682a5046dd51802a687a81ace91
     # 2106-02-07 06:28:18 -11309508

The main problem is that the 'commit-graph verify' return error:

     git commit-graph write
     git commit-graph verify
     # commit-graph generation for commit 
1763a5017d8c0a9af6094fde91c43a5722bbde4c is 1699836629 < 4702109779
     # Verifying commits in commit graph: 100% (9489/9489), done.

     echo $?
     # 1

And this results in an error on fsck:

     git fsck
     # ...
     # error in commit 381ac1d9a82c9682a5046dd51802a687a81ace91: 
badTimezone: invalid author/committer line - bad time zone
     # ...
     # commit-graph generation for commit 
1763a5017d8c0a9af6094fde91c43a5722bbde4c is 1699836629 < 4702109779
     # ...

     echo $?
     # 20

I found that first error can be masked using 'fsck.skiplist' file. But 
can't find how to mask the second.
Is there a workaround for this case?

System info:
* git version: 2.43.0
* OS: Debian GNU/Linux 11 (bullseye), x86_64

Notes:
* This error originally occurred on a local GitLab installation, that 
periodically run fsck on all repos. And the poco repo mirror in our 
GitLab instance is now marked as failed.
* Another strange thing about this commit is that git can't find any 
belonging branch for it, but parent and child commits are has ones:

     git log --pretty=format:"%h %ad | %s%d [%an]" --graph --date=short 
-n10 4261-move-autocommit-abstractsession
     # ac7e39ff8 2023-11-14 | Fixed indentation in ci.yml 
(4261-move-autocommit-abstractsession) [Friedrich Wilckens]
     # 543ea150a 2023-11-14 | Github workflow: re-activated 
linux-gcc-make-postgres [Friedrich Wilckens]
     # a2d10dffe 2023-11-13 | PostgreSQL SessionImpl: reuse autocommit 
flag of AbstractSessionImpl. [Friedrich Wilckens]
     # d32f62031 2023-11-13 | MySQL SessionImpl: make sure autocommit 
mode is on when session is openend or reset. [Friedrich Wilckens]
     # c919b7f79 2023-11-13 | chore(CI): re-enable mysql [Alex Fabijanic]
     # ffd0007f2 2023-11-13 | fix(Data::AbstracSessionImpl): protect 
autocommit feature handlers #4261 [Alex Fabijanic]
     # 1763a5017 2023-11-12 | Brought MySQL backend in line with 
_autoCommit flag of AbstractSessionImpl. [Friedrich Wilckens]
     # 381ac1d9a 2106-02-07 | feat(Data::AbstractSessionImpl): add 
autoCommit property and tests #4261 [Alex Fabijanic] <---
     # 18eea1bb7 2023-11-11 | temporarily comment failing mysql ci until 
fixed [Aleksandar Fabijanic]
     # 6a5387ec2 2023-11-11 | add visitor pattern implementation for 
Poco::Dynamic::Var (#4144) [Alexander B]

     for _c in 1763a5017 381ac1d9a 18eea1bb7; do
       echo "* $_c:";
       git branch --contains=$_c | sed 's/^/  /';
     done
     # * 1763a5017:
     #     4261-move-autocommit-abstractsession
     # * 381ac1d9a:
     # * 18eea1bb7:
     # 
2366-pocoprocesslaunch-unix-possible-memory-leak-when-launching-invalid-command
     #     4261-move-autocommit-abstractsession
     #     569-DateTimeParser-cherry-pick
     #     devel

Links:
[1]: https://github.com/pocoproject/poco
[2]: 
https://github.com/pocoproject/poco/commit/381ac1d9a82c9682a5046dd51802a687a81ace91



^ permalink raw reply

* Re: [PATCH] git-compat-util: convert skip_{prefix,suffix}{,_mem} to bool
From: René Scharfe @ 2023-12-19 13:36 UTC (permalink / raw)
  To: Junio C Hamano, Phillip Wood
  Cc: git, AtariDreams via GitGitGadget, Seija Kijin, Jeff King,
	Phillip Wood
In-Reply-To: <xmqqa5q7e00q.fsf@gitster.g>

Am 18.12.23 um 21:19 schrieb Junio C Hamano:
> Phillip Wood <phillip.wood123@gmail.com> writes:
>
>> Thanks for the comprehensive commit message, I agree that we'd be
>> better off avoiding adding a fallback. The patch looks good, I did
>> wonder if we really need to covert all of these functions for a
>> test-balloon but the patch is still pretty small overall.
>
> I do have to wonder, though, if we want to be a bit more careful
> than just blindly trusting the platform (i.e. <stdbool.h> might
> exist and __STDC_VERSION__ may say C99, but under the hood their
> implementation may be buggy and coerce the result of an assignment
> of 2 to be different from assigning true).

We could add a compile-time check like below.  I can't decide if this
would be prudent or paranoid.  It's cheap, though, so perhaps just add
this tripwire for non-conforming compilers without making a judgement?

René



diff --git a/git-compat-util.h b/git-compat-util.h
index 603c97e3b3..8212feaa37 100644
--- a/git-compat-util.h
+++ b/git-compat-util.h
@@ -705,7 +705,7 @@ static inline bool skip_prefix(const char *str, const char *prefix,
 {
 	do {
 		if (!*prefix) {
-			*out = str;
+			*out = str + BUILD_ASSERT_OR_ZERO((bool)1 == (bool)2);
 			return true;
 		}
 	} while (*str++ == *prefix++);

^ permalink raw reply related

* Re: [PATCH] rebase: use strvec_pushf() for format-patch revisions
From: Patrick Steinhardt @ 2023-12-19 12:25 UTC (permalink / raw)
  To: René Scharfe; +Cc: Git List
In-Reply-To: <4ab7431c-6c1b-448c-b4d2-e8b9be0e4eef@web.de>

[-- Attachment #1: Type: text/plain, Size: 2991 bytes --]

On Tue, Dec 19, 2023 at 08:42:18AM +0100, René Scharfe wrote:
> In run_am(), a strbuf is used to create a revision argument that is then
> added to the argument list for git format-patch using strvec_push().
> Use strvec_pushf() to add it directly instead, simplifying the code.
> 
> Signed-off-by: René Scharfe <l.s.r@web.de>

Thanks, this simplification looks good to me!

Patrick

> ---
> Formatted with --inter-hunk-context=14 for easier review.
> 
>  builtin/rebase.c | 17 ++++++-----------
>  1 file changed, 6 insertions(+), 11 deletions(-)
> 
> diff --git a/builtin/rebase.c b/builtin/rebase.c
> index 9f8192e0a5..ddde4cbb87 100644
> --- a/builtin/rebase.c
> +++ b/builtin/rebase.c
> @@ -582,7 +582,6 @@ static int run_am(struct rebase_options *opts)
>  {
>  	struct child_process am = CHILD_PROCESS_INIT;
>  	struct child_process format_patch = CHILD_PROCESS_INIT;
> -	struct strbuf revisions = STRBUF_INIT;
>  	int status;
>  	char *rebased_patches;
> 
> @@ -615,34 +614,32 @@ static int run_am(struct rebase_options *opts)
>  		return run_command(&am);
>  	}
> 
> -	strbuf_addf(&revisions, "%s...%s",
> -		    oid_to_hex(opts->root ?
> -			       /* this is now equivalent to !opts->upstream */
> -			       &opts->onto->object.oid :
> -			       &opts->upstream->object.oid),
> -		    oid_to_hex(&opts->orig_head->object.oid));
> -
>  	rebased_patches = xstrdup(git_path("rebased-patches"));
>  	format_patch.out = open(rebased_patches,
>  				O_WRONLY | O_CREAT | O_TRUNC, 0666);
>  	if (format_patch.out < 0) {
>  		status = error_errno(_("could not open '%s' for writing"),
>  				     rebased_patches);
>  		free(rebased_patches);
>  		strvec_clear(&am.args);
>  		return status;
>  	}
> 
>  	format_patch.git_cmd = 1;
>  	strvec_pushl(&format_patch.args, "format-patch", "-k", "--stdout",
>  		     "--full-index", "--cherry-pick", "--right-only",
>  		     "--default-prefix", "--no-renames",
>  		     "--no-cover-letter", "--pretty=mboxrd", "--topo-order",
>  		     "--no-base", NULL);
>  	if (opts->git_format_patch_opt.len)
>  		strvec_split(&format_patch.args,
>  			     opts->git_format_patch_opt.buf);
> -	strvec_push(&format_patch.args, revisions.buf);
> +	strvec_pushf(&format_patch.args, "%s...%s",
> +		     oid_to_hex(opts->root ?
> +				/* this is now equivalent to !opts->upstream */
> +				&opts->onto->object.oid :
> +				&opts->upstream->object.oid),
> +		     oid_to_hex(&opts->orig_head->object.oid));
>  	if (opts->restrict_revision)
>  		strvec_pushf(&format_patch.args, "^%s",
>  			     oid_to_hex(&opts->restrict_revision->object.oid));
> @@ -665,10 +662,8 @@ static int run_am(struct rebase_options *opts)
>  			"As a result, git cannot rebase them."),
>  		      opts->revisions);
> 
> -		strbuf_release(&revisions);
>  		return status;
>  	}
> -	strbuf_release(&revisions);
> 
>  	am.in = open(rebased_patches, O_RDONLY);
>  	if (am.in < 0) {
> --
> 2.43.0
> 

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply

* [BUG] `git add -p` seems to corrupt a sparse index
From: Sean Allred @ 2023-12-19 11:20 UTC (permalink / raw)
  To: git


What did you do before the bug happened? (Steps to reproduce your issue)

    git init
    for dir in a b c; do mkdir $dir && seq 1 20 > $dir/file; done
    git add -A && git commit -m'Some content'

    git sparse-checkout set --sparse-index b
    seq 1 20 > b/file-2
    git add -N b/file-2
    git add -p b/file-2
    git status

What did you expect to happen? (Expected behavior)

  I expected to be dropped into the interactive-add workflow / see my
  changes in git-status.

What happened instead? (Actual behavior)

  git-add reports 'No changes' and git-status reports nothing at all
  (empty output).

  The original internal report also was able reproduce messaging like

      fatal: cache entry out of order
      warning: die() called many times. Recursion error or racy threaded death!
      fatal: cache entry out of order
      fatal: cache entry out of order
      fatal: cache entry out of order

  though I've not been able to reproduce that myself. It seems relevant
  / worth noting that core.fsmonitor would be set to 'true' in that
  repository.

What's different between what you expected and what actually happened?

  git-status appears to silently crash in the error case.

  Compare the broken workflow with any of the following variants (all of
  which work as expected):

  - don't use `--intent-to-add`:

      git init
      for dir in a b c; do mkdir $dir && seq 1 20 > $dir/file; done
      git add -A && git commit -m'Some content'
      git sparse-checkout set --sparse-index b
      seq 1 20 > b/file-2
      git add b/file-2
      git status

  - don't use `sparse-checkout` at all:

      git init
      for dir in a b c; do mkdir $dir && seq 1 20 > $dir/file; done
      git add -A && git commit -m'Some content'
      seq 1 20 > b/file-2
      git add -N b/file-2
      git add -p b/file-2
      git status

  - don't use `--sparse-index` specifically:

      git init
      for dir in a b c; do mkdir $dir && seq 1 20 > $dir/file; done
      git add -A && git commit -m'Some content'
      git sparse-checkout set b
      seq 1 20 > b/file-2
      git add -N b/file-2
      git add -p b/file-2
      git status

Anything else you want to add:

  Seems very related to the use of sparse-index.

Please review the rest of the bug report below.
You can delete any lines you don't wish to share.


[System Info]
git version:
git version 2.43.0.windows.1
cpu: x86_64
built from commit: 4b968f3ea3b32a7bc50846bab49f3f381841d297
sizeof-long: 4
sizeof-size_t: 8
shell-path: /bin/sh
feature: fsmonitor--daemon
uname: Windows 10.0 19044
compiler info: gnuc: 13.2
libc info: no libc information available
$SHELL (typically, interactive shell): C:\Program Files\Git\usr\bin\bash.exe


[Enabled Hooks]


--
Sean Allred

^ permalink raw reply

* Re: [PATCH] rebase: use strvec_pushf() for format-patch revisions
From: Phillip Wood @ 2023-12-19 11:07 UTC (permalink / raw)
  To: René Scharfe, Git List
In-Reply-To: <4ab7431c-6c1b-448c-b4d2-e8b9be0e4eef@web.de>

Hi René

On 19/12/2023 07:42, René Scharfe wrote:
> In run_am(), a strbuf is used to create a revision argument that is then
> added to the argument list for git format-patch using strvec_push().
> Use strvec_pushf() to add it directly instead, simplifying the code.

This looks like a nice simplification and the extra context lines in the 
patch are much appreciated

Thanks

Phillip

> Signed-off-by: René Scharfe <l.s.r@web.de>
> ---
> Formatted with --inter-hunk-context=14 for easier review.
> 
>   builtin/rebase.c | 17 ++++++-----------
>   1 file changed, 6 insertions(+), 11 deletions(-)
> 
> diff --git a/builtin/rebase.c b/builtin/rebase.c
> index 9f8192e0a5..ddde4cbb87 100644
> --- a/builtin/rebase.c
> +++ b/builtin/rebase.c
> @@ -582,7 +582,6 @@ static int run_am(struct rebase_options *opts)
>   {
>   	struct child_process am = CHILD_PROCESS_INIT;
>   	struct child_process format_patch = CHILD_PROCESS_INIT;
> -	struct strbuf revisions = STRBUF_INIT;
>   	int status;
>   	char *rebased_patches;
> 
> @@ -615,34 +614,32 @@ static int run_am(struct rebase_options *opts)
>   		return run_command(&am);
>   	}
> 
> -	strbuf_addf(&revisions, "%s...%s",
> -		    oid_to_hex(opts->root ?
> -			       /* this is now equivalent to !opts->upstream */
> -			       &opts->onto->object.oid :
> -			       &opts->upstream->object.oid),
> -		    oid_to_hex(&opts->orig_head->object.oid));
> -
>   	rebased_patches = xstrdup(git_path("rebased-patches"));
>   	format_patch.out = open(rebased_patches,
>   				O_WRONLY | O_CREAT | O_TRUNC, 0666);
>   	if (format_patch.out < 0) {
>   		status = error_errno(_("could not open '%s' for writing"),
>   				     rebased_patches);
>   		free(rebased_patches);
>   		strvec_clear(&am.args);
>   		return status;
>   	}
> 
>   	format_patch.git_cmd = 1;
>   	strvec_pushl(&format_patch.args, "format-patch", "-k", "--stdout",
>   		     "--full-index", "--cherry-pick", "--right-only",
>   		     "--default-prefix", "--no-renames",
>   		     "--no-cover-letter", "--pretty=mboxrd", "--topo-order",
>   		     "--no-base", NULL);
>   	if (opts->git_format_patch_opt.len)
>   		strvec_split(&format_patch.args,
>   			     opts->git_format_patch_opt.buf);
> -	strvec_push(&format_patch.args, revisions.buf);
> +	strvec_pushf(&format_patch.args, "%s...%s",
> +		     oid_to_hex(opts->root ?
> +				/* this is now equivalent to !opts->upstream */
> +				&opts->onto->object.oid :
> +				&opts->upstream->object.oid),
> +		     oid_to_hex(&opts->orig_head->object.oid));
>   	if (opts->restrict_revision)
>   		strvec_pushf(&format_patch.args, "^%s",
>   			     oid_to_hex(&opts->restrict_revision->object.oid));
> @@ -665,10 +662,8 @@ static int run_am(struct rebase_options *opts)
>   			"As a result, git cannot rebase them."),
>   		      opts->revisions);
> 
> -		strbuf_release(&revisions);
>   		return status;
>   	}
> -	strbuf_release(&revisions);
> 
>   	am.in = open(rebased_patches, O_RDONLY);
>   	if (am.in < 0) {
> --
> 2.43.0
> 

^ permalink raw reply

* RE: Problems with Windows + schannel + http.sslCert
From: Ragesh Krishna @ 2023-12-19 10:18 UTC (permalink / raw)
  To: Johannes Schindelin; +Cc: git@vger.kernel.org
In-Reply-To: <710affcd-f6bf-371c-d7e3-8bce3b01da3c@gmx.de>

Hi Johannes,

> However, contrary to what `git -c http.sslBackend=list ls-remote <url>` says on Windows, `git -c http.sslBackend=openssl ls-remote <url>` should work, too.

Thanks for the tip! Although I haven't made any further attempts to try and force openssl, I was able to get client auth to work with Git for Windows by ensuring the client cert and root cert are present in the Windows certificate store and then setting "http.sslCert" to "CurrentUser\\MY\\{certificate thumbprint}}". This gets everything to fall into place and I suspect that it is the "correct" way, for better or worse, to make it work on Windows.

One thing that tripped me up was that my root CA was using ed25519 for signatures, and my installation of Windows did not seem to like that one bit. Switching to ECDSA seemed to fix it. I suppose that's another rabbit hole I need to jump into, but it has nothing to do with Git :)

Regards,
-- Ragesh.

^ permalink raw reply

* [PATCH 8/8] SubmittingPatches: hyphenate non-ASCII
From: Josh Soref via GitGitGadget @ 2023-12-19  8:41 UTC (permalink / raw)
  To: git; +Cc: Elijah Newren, Josh Soref, Josh Soref
In-Reply-To: <pull.1623.git.1702975319.gitgitgadget@gmail.com>

From: Josh Soref <jsoref@gmail.com>

Git documentation does this with the exception of ancient release notes.

Signed-off-by: Josh Soref <jsoref@gmail.com>
---
 Documentation/SubmittingPatches | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Documentation/SubmittingPatches b/Documentation/SubmittingPatches
index b4fa52ae348..3c53592cfc8 100644
--- a/Documentation/SubmittingPatches
+++ b/Documentation/SubmittingPatches
@@ -700,7 +700,7 @@ message to an external program, and this is a handy way to drive
 `git am`.  However, if the message is MIME encoded, what is
 piped into the program is the representation you see in your
 `*Article*` buffer after unwrapping MIME.  This is often not what
-you would want for two reasons.  It tends to screw up non ASCII
+you would want for two reasons.  It tends to screw up non-ASCII
 characters (most notably in people's names), and also
 whitespaces (fatal in patches).  Running "C-u g" to display the
 message in raw form before using "|" to run the pipe can work
-- 
gitgitgadget

^ permalink raw reply related

* [PATCH 7/8] SubmittingPatches: clarify GitHub artifact format
From: Josh Soref via GitGitGadget @ 2023-12-19  8:41 UTC (permalink / raw)
  To: git; +Cc: Elijah Newren, Josh Soref, Josh Soref
In-Reply-To: <pull.1623.git.1702975319.gitgitgadget@gmail.com>

From: Josh Soref <jsoref@gmail.com>

GitHub wraps artifacts generated by workflows in a .zip file.

Internally workflows can package anything they like in them.

A recently generated failure artifact had the form:

windows-artifacts.zip
  Length      Date    Time    Name
---------  ---------- -----   ----
 76001695  12-19-2023 01:35   artifacts.tar.gz
 11005650  12-19-2023 01:35   tracked.tar.gz
---------                     -------
 87007345                     2 files

Signed-off-by: Josh Soref <jsoref@gmail.com>
---
 Documentation/SubmittingPatches | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/Documentation/SubmittingPatches b/Documentation/SubmittingPatches
index 8e19c7f82e4..b4fa52ae348 100644
--- a/Documentation/SubmittingPatches
+++ b/Documentation/SubmittingPatches
@@ -606,7 +606,8 @@ branches here: `https://github.com/<Your GitHub handle>/git/actions/workflows/ma
 If a branch did not pass all test cases then it is marked with a red
 +x+. In that case you can click on the failing job and navigate to
 "ci/run-build-and-tests.sh" and/or "ci/print-test-failures.sh". You
-can also download "Artifacts" which are tarred (or zipped) archives
+can also download "Artifacts" which are zip archives containing
+tarred (or zipped) archives
 with test data relevant for debugging.
 
 Then fix the problem and push your fix to your GitHub fork. This will
-- 
gitgitgadget


^ permalink raw reply related

* [PATCH 6/8] SubmittingPatches: clarify GitHub visual
From: Josh Soref via GitGitGadget @ 2023-12-19  8:41 UTC (permalink / raw)
  To: git; +Cc: Elijah Newren, Josh Soref, Josh Soref
In-Reply-To: <pull.1623.git.1702975319.gitgitgadget@gmail.com>

From: Josh Soref <jsoref@gmail.com>

Some people would expect a cross to be upright, and potentially have
unequal lengths...

GitHub uses a white x overlaying a solid red circle to indicate failure.

Signed-off-by: Josh Soref <jsoref@gmail.com>
---
 Documentation/SubmittingPatches | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Documentation/SubmittingPatches b/Documentation/SubmittingPatches
index d7a84f59478..8e19c7f82e4 100644
--- a/Documentation/SubmittingPatches
+++ b/Documentation/SubmittingPatches
@@ -604,7 +604,7 @@ to your fork of Git on GitHub.  You can monitor the test state of all your
 branches here: `https://github.com/<Your GitHub handle>/git/actions/workflows/main.yml`
 
 If a branch did not pass all test cases then it is marked with a red
-cross. In that case you can click on the failing job and navigate to
++x+. In that case you can click on the failing job and navigate to
 "ci/run-build-and-tests.sh" and/or "ci/print-test-failures.sh". You
 can also download "Artifacts" which are tarred (or zipped) archives
 with test data relevant for debugging.
-- 
gitgitgadget


^ permalink raw reply related

* [PATCH 5/8] SubmittingPatches: improve extra tags advice
From: Josh Soref via GitGitGadget @ 2023-12-19  8:41 UTC (permalink / raw)
  To: git; +Cc: Elijah Newren, Josh Soref, Josh Soref
In-Reply-To: <pull.1623.git.1702975319.gitgitgadget@gmail.com>

From: Josh Soref <jsoref@gmail.com>

Current statistics show a strong preference to only capitalize the first
letter in a hyphenated tag, but that some guidance would be helpful:

git log |
  perl -ne 'next unless /^\s+(?:Signed-[oO]ff|Acked)-[bB]y:/;
    s/^\s+//;s/:.*/:/;print'|
  sort|uniq -c|sort -n
   2 Signed-off-By:
   4 Signed-Off-by:
  22 Acked-By:
  47 Signed-Off-By:
2202 Acked-by:
95315 Signed-off-by:

Signed-off-by: Josh Soref <jsoref@gmail.com>
---
 Documentation/SubmittingPatches | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/Documentation/SubmittingPatches b/Documentation/SubmittingPatches
index 694a7bafb68..d7a84f59478 100644
--- a/Documentation/SubmittingPatches
+++ b/Documentation/SubmittingPatches
@@ -369,6 +369,9 @@ If you like, you can put extra tags at the end:
 You can also create your own tag or use one that's in common usage
 such as "Thanks-to:", "Based-on-patch-by:", or "Improved-by:".
 
+Extra tags should only capitalize the very first letter, i.e. favor
+"Signed-off-by" over "Signed-Off-By" and "Acked-by:" over "Acked-By".
+
 [[git-tools]]
 === Generate your patch using Git tools out of your commits.
 
-- 
gitgitgadget


^ permalink raw reply related

* [PATCH 4/8] SubmittingPatches: update extra tags list
From: Josh Soref via GitGitGadget @ 2023-12-19  8:41 UTC (permalink / raw)
  To: git; +Cc: Elijah Newren, Josh Soref, Josh Soref
In-Reply-To: <pull.1623.git.1702975319.gitgitgadget@gmail.com>

From: Josh Soref <jsoref@gmail.com>

Add items with at least 100 uses:
- Co-authored-by
- Helped-by
- Mentored-by
- Suggested-by

Updating the create suggestion to something less commonly used.

git log |
  perl -ne 'next unless /^\s+[A-Z][a-z]+-\S+:/;s/^\s+//;s/:.*/:/;print'|
  sort|uniq -c|sort -n|grep '[0-9][0-9] '
  11 Helped-By:
  13 Message-ID:
  14 Reported-By:
  22 Acked-By:
  27 Inspired-by:
  29 Requested-by:
  35 Original-patch-by:
  43 Contributions-by:
  47 Signed-Off-By:
  65 Based-on-patch-by:
  68 Thanks-to:
  88 Improved-by:
 145 Co-authored-by:
 171 Noticed-by:
 182 Tested-by:
 361 Suggested-by:
 469 Mentored-by:
1196 Reported-by:
1727 Helped-by:
2177 Reviewed-by:
2202 Acked-by:
95313 Signed-off-by:

Signed-off-by: Josh Soref <jsoref@gmail.com>
---
 Documentation/SubmittingPatches | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/Documentation/SubmittingPatches b/Documentation/SubmittingPatches
index 32e90238777..694a7bafb68 100644
--- a/Documentation/SubmittingPatches
+++ b/Documentation/SubmittingPatches
@@ -348,6 +348,8 @@ If you like, you can put extra tags at the end:
 
 . `Reported-by:` is used to credit someone who found the bug that
   the patch attempts to fix.
+. `Noticed-by:` liked `Reported-by:` indicates someone who noticed
+  the item being fixed.
 . `Acked-by:` says that the person who is more familiar with the area
   the patch attempts to modify liked the patch.
 . `Reviewed-by:`, unlike the other tags, can only be offered by the
@@ -355,9 +357,17 @@ If you like, you can put extra tags at the end:
   patch after a detailed analysis.
 . `Tested-by:` is used to indicate that the person applied the patch
   and found it to have the desired effect.
+. `Co-authored-by:` is used to indicate that multiple people
+  contributed to the work of a patch.
+. `Helped-by:` is used to credit someone with helping develop a
+  patch.
+. `Mentored-by:` is used to credit someone with helping develop a
+  patch.
+. `Suggested-by:` is used to credit someone with suggesting the idea
+  for a patch.
 
 You can also create your own tag or use one that's in common usage
-such as "Thanks-to:", "Based-on-patch-by:", or "Mentored-by:".
+such as "Thanks-to:", "Based-on-patch-by:", or "Improved-by:".
 
 [[git-tools]]
 === Generate your patch using Git tools out of your commits.
-- 
gitgitgadget


^ permalink raw reply related

* [PATCH 3/8] SubmittingPatches: drop ref to "What's in git.git"
From: Josh Soref via GitGitGadget @ 2023-12-19  8:41 UTC (permalink / raw)
  To: git; +Cc: Elijah Newren, Josh Soref, Josh Soref
In-Reply-To: <pull.1623.git.1702975319.gitgitgadget@gmail.com>

From: Josh Soref <jsoref@gmail.com>

"What's in git.git" was last seen in 2010:
  https://lore.kernel.org/git/?q=%22what%27s+in+git.git%22
  https://lore.kernel.org/git/7vaavikg72.fsf@alter.siamese.dyndns.org/

Signed-off-by: Josh Soref <jsoref@gmail.com>
---
 Documentation/SubmittingPatches | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Documentation/SubmittingPatches b/Documentation/SubmittingPatches
index bce7f97815c..32e90238777 100644
--- a/Documentation/SubmittingPatches
+++ b/Documentation/SubmittingPatches
@@ -570,7 +570,7 @@ their trees themselves.
   master).
 
 * Read the Git mailing list, the maintainer regularly posts messages
-  entitled "What's cooking in git.git" and "What's in git.git" giving
+  entitled "What's cooking in git.git" giving
   the status of various proposed changes.
 
 == GitHub CI[[GHCI]]
-- 
gitgitgadget


^ permalink raw reply related

* [PATCH 2/8] CodingGuidelines: write punctuation marks
From: Josh Soref via GitGitGadget @ 2023-12-19  8:41 UTC (permalink / raw)
  To: git; +Cc: Elijah Newren, Josh Soref, Josh Soref
In-Reply-To: <pull.1623.git.1702975319.gitgitgadget@gmail.com>

From: Josh Soref <jsoref@gmail.com>

- Match style in Release Notes

Signed-off-by: Josh Soref <jsoref@gmail.com>
---
 Documentation/CodingGuidelines | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Documentation/CodingGuidelines b/Documentation/CodingGuidelines
index af94ed3a75d..578587a4715 100644
--- a/Documentation/CodingGuidelines
+++ b/Documentation/CodingGuidelines
@@ -578,7 +578,7 @@ Externally Visible Names
    . The variable name describes the effect of tweaking this knob.
 
    The section and variable names that consist of multiple words are
-   formed by concatenating the words without punctuations (e.g. `-`),
+   formed by concatenating the words without punctuation marks (e.g. `-`),
    and are broken using bumpyCaps in documentation as a hint to the
    reader.
 
-- 
gitgitgadget


^ permalink raw reply related

* [PATCH 1/8] CodingGuidelines: move period inside parentheses
From: Josh Soref via GitGitGadget @ 2023-12-19  8:41 UTC (permalink / raw)
  To: git; +Cc: Elijah Newren, Josh Soref, Josh Soref
In-Reply-To: <pull.1623.git.1702975319.gitgitgadget@gmail.com>

From: Josh Soref <jsoref@gmail.com>

The contents within parenthesis should be omittable without resulting
in broken text.

Eliding the parenthesis left a period to end a run without any content.

Signed-off-by: Josh Soref <jsoref@gmail.com>
---
 Documentation/CodingGuidelines | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Documentation/CodingGuidelines b/Documentation/CodingGuidelines
index 8ed517a5ca0..af94ed3a75d 100644
--- a/Documentation/CodingGuidelines
+++ b/Documentation/CodingGuidelines
@@ -450,7 +450,7 @@ For C programs:
    one of the approved headers that includes it first for you.  (The
    approved headers currently include "builtin.h",
    "t/helper/test-tool.h", "xdiff/xinclude.h", or
-   "reftable/system.h").  You do not have to include more than one of
+   "reftable/system.h".)  You do not have to include more than one of
    these.
 
  - A C file must directly include the header files that declare the
-- 
gitgitgadget


^ permalink raw reply related

* [PATCH 0/8] Minor improvements to CodingGuidelines and SubmittingPatches
From: Josh Soref via GitGitGadget @ 2023-12-19  8:41 UTC (permalink / raw)
  To: git; +Cc: Elijah Newren, Josh Soref

These are a bunch of things I've run into over my past couple of attempts to
contribute to Git.

 * Incremental punctuation/grammatical improvements
 * Update extra tags suggestions based on common usage
 * drop reference to an article that was discontinued over a decade ago
 * update GitHub references
 * harmonize non-ASCII while I'm here

Note that I'm trying to do things "in the neighborhood". It'll be slower
than me replacing things topically, but hopefully easier for others to
digest. My current estimate is a decade or two :).

Josh Soref (8):
  CodingGuidelines: move period inside parentheses
  CodingGuidelines: write punctuation marks
  SubmittingPatches: drop ref to "What's in git.git"
  SubmittingPatches: update extra tags list
  SubmittingPatches: improve extra tags advice
  SubmittingPatches: clarify GitHub visual
  SubmittingPatches: clarify GitHub artifact format
  SubmittingPatches: hyphenate non-ASCII

 Documentation/CodingGuidelines  |  4 ++--
 Documentation/SubmittingPatches | 24 +++++++++++++++++++-----
 2 files changed, 21 insertions(+), 7 deletions(-)


base-commit: 624eb90fa8f65a79396615f3c2842ac5a3743350
Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-1623%2Fjsoref%2Fdocumentation-v1
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-1623/jsoref/documentation-v1
Pull-Request: https://github.com/gitgitgadget/git/pull/1623
-- 
gitgitgadget

^ permalink raw reply

* Re: Unable to install git-2.43.0 from source on macOS Big Sur 11.7.10
From: Eric Sunshine @ 2023-12-19  7:55 UTC (permalink / raw)
  To: Jonathan Abrams; +Cc: git@vger.kernel.org
In-Reply-To: <IA1PR12MB60445F50DD0F844B2B779BA8B890A@IA1PR12MB6044.namprd12.prod.outlook.com>

On Mon, Dec 18, 2023 at 7:03 AM Jonathan Abrams
<jonathansabrams@outlook.com> wrote:
> The contents of "config.mak.autogen" are as follows:
> --
> CURL_LDFLAGS=-L/Users/jonathana/opt/anaconda3/lib -lcurl
> CHARSET_LIB=-liconv

So, 'configure' found a "libiconv". Okay.

> The last output of make V=1 all is as follows.
> --
> gcc   -g -O2 -I. -o git-daemon daemon.o common-main.o libgit.a xdiff/lib.a reftable/libreftable.a libgit.a -lz  -liconv  -liconv

And it's linking against "libiconv" (the "-iconv" part). Good.

> Undefined symbols for architecture x86_64:
>   "_libiconv", referenced from:
>       _precompose_utf8_readdir in libgit.a(precompose_utf8.o)
>       _reencode_string_iconv in libgit.a(utf8.o)

But it doesn't seem to like your "libiconv" for some reason.

I notice that you seem to have an Anaconda environment active. Do you
know if this "libiconv" happens to reside within the Anaconda
environment? If so, what version is it and from where was it installed
("conda-forge", "anaconda", some other)?

Have you tried deactivating the Anaconda environment ("conda
deactivate") before building Git? Also, I would suggest trying without
even running the configure script at all. So, for instance:

  % cd git
  % conda deactivate
  % make distclean
  % make all

^ permalink raw reply


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox