Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Libgit2update #153

Open
wants to merge 44 commits into
base: master
Choose a base branch
from
Open

Libgit2update #153

wants to merge 44 commits into from

Conversation

Murmele
Copy link
Owner

@Murmele Murmele commented May 1, 2022

  • blame: fix update from buffer

  • remote: add callbacks for connect/disconnect

    • pullrequest at libgit2 pending
    • branch: origin/callback_connect_disconnect
  • hash: changed git_repository_hashfile to hash symlinks the same as when they are added to the index

    • branch: origin/hash
  • submodule: pass absolute path to clone
    The init callback worked because it uses the parent repo path to contruct
    distinct repo and working directories, but the tests for an existing empty
    directory in git_clone were relative to the current working directory
    instead of the parent repository directory.

    • branch: origin/submodule
    • changed git_submodule_status to take a submodule instead of a repo and name
    • not needed anymore!
  • patch: add context lines accessor

    • pullrequest at libgit2 pending
    • branch: 'origin/context_line_accessor´
  • patch: add owner accessor

    • already upstream
  • patch: added flag to disable mmap

    • really needed?
  • push: fixed several update callback issues
    Update callback is no longer called (and the reference isn't updated) when the
    local and remote oids already match. The update callback is now called for tags.
    Finally, fixed a leak when there are multiple refspecs.

    • branch: fix_push_callback_issues
  • diff: initialize git_diff_options.context_lines to an invalid default value and read 'diff.context' when the value is invalid

    • branch: "origin/diff_checkout"
  • checkout: notify for deleted files

    • really needed?
    • branch: "origin/checkout_deletion_notification"
  • blame: disable rename detection

    • really needed?
    • branch: "origin/disableRenameDetection"
  • blame: add blame progress callback

    • submitted as pr to upstream
    • branch: origin/blame_abort
  • fetch: work around failure to fetch annotated tags added to existing commits

    • branch: origin/fetch_annotated_tags

@exactly-one-kas exactly-one-kas added the enhancement New feature or request label May 2, 2022
@Murmele Murmele marked this pull request as ready for review May 9, 2022 09:55
@Murmele Murmele marked this pull request as draft May 9, 2022 09:56
@Murmele Murmele marked this pull request as ready for review August 24, 2022 08:54
@Murmele Murmele marked this pull request as draft August 24, 2022 08:54
@Murmele Murmele force-pushed the libgit2update branch 2 times, most recently from 51a100a to e24c7fb Compare August 29, 2022 12:43
@Murmele Murmele closed this Aug 29, 2022
@Murmele Murmele deleted the libgit2update branch August 29, 2022 13:42
@Murmele Murmele restored the libgit2update branch August 29, 2022 13:43
@Murmele Murmele reopened this Aug 29, 2022
@Murmele
Copy link
Owner Author

Murmele commented Aug 30, 2022

@exactly-one-kas

2022-08-30T05:59:31.5311212Z C:\PROGRA~1\MICROS~2\2022\ENTERP~1\VC\Tools\Llvm\x64\bin\clang.exe -DWIN32 -D_WIN32_WINNT=0x0600 -ID:/a/Gittyup/Gittyup/build/release/dep/libgit2/libgit2/src/util -ID:/a/Gittyup/Gittyup/build/release/dep/libgit2/libgit2/include -ID:/a/Gittyup/Gittyup/build/release/dep/libgit2/libgit2/include/git2 -ID:/a/Gittyup/Gittyup/dep/libgit2/libgit2/src/libgit2 -ID:/a/Gittyup/Gittyup/dep/libgit2/libgit2/src/util -ID:/a/Gittyup/Gittyup/dep/libgit2/libgit2/include -D_GNU_SOURCE  -Wall -Wextra -Wdocumentation -Wno-documentation-deprecated-sync -Wno-missing-field-initializers -Wmissing-declarations -Wstrict-aliasing -Wstrict-prototypes -Wdeclaration-after-statement -Wshift-count-overflow -Wunused-const-variable -Wunused-function -Wint-conversion -Wc11-extensions -Wformat -Wformat-security -O3 -DNDEBUG -D_DLL -D_MT -Xclang --dependent-lib=msvcrt -Wall -Wextra -pedantic -Werror -std=c90 -MD -MT dep/libgit2/libgit2/tests/headertest/CMakeFiles/headertest.dir/headertest.c.obj -MF dep\libgit2\libgit2\tests\headertest\CMakeFiles\headertest.dir\headertest.c.obj.d -o dep/libgit2/libgit2/tests/headertest/CMakeFiles/headertest.dir/headertest.c.obj -c D:/a/Gittyup/Gittyup/dep/libgit2/libgit2/tests/headertest/headertest.c
2022-08-30T05:59:31.5352321Z In file included from D:/a/Gittyup/Gittyup/dep/libgit2/libgit2/tests/headertest/headertest.c:8:
2022-08-30T05:59:31.5365379Z In file included from D:/a/Gittyup/Gittyup/build/release/dep/libgit2/libgit2/include\git2.h:11:
2022-08-30T05:59:31.5368894Z In file included from D:/a/Gittyup/Gittyup/dep/libgit2/libgit2/include\git2/annotated_commit.h:11:
2022-08-30T05:59:31.5471330Z In file included from D:/a/Gittyup/Gittyup/dep/libgit2/libgit2/include\git2/repository.h:11:
2022-08-30T05:59:31.5474484Z D:/a/Gittyup/Gittyup/dep/libgit2/libgit2/include\git2/types.h:41:9: error: extension used [-Werror,-Wlanguage-extension-token]
2022-08-30T05:59:31.5475297Z typedef __int64 git_off_t;
2022-08-30T05:59:31.5475665Z         ^
2022-08-30T05:59:31.5476688Z D:/a/Gittyup/Gittyup/dep/libgit2/libgit2/include\git2/types.h:41:9: error: 'long long' is an extension when C99 mode is not enabled [-Werror,-Wlong-long]
2022-08-30T05:59:31.5477275Z 2 errors generated.

Do you understand why -Wlong-long -Werror is turned On on windows build?

@Murmele
Copy link
Owner Author

Murmele commented Sep 7, 2022

@exactly-one-kas are you using VS to build Gittyup? I'm using MinGW and there the Werror is not turned on

@exactly-one-kas
Copy link
Collaborator

MSVC works, and the error that required to use clang seems to be gone now, I'll switch back to MSVC

@Murmele
Copy link
Owner Author

Murmele commented Oct 5, 2022

I asked once in the libgit2 slack channel, but got no response

Hi, I am trying to move from git_filter.apply to git_filter.stream. I checked out the unittests to get a feeling how it should be. There I have seen for example in the wildcard test:

static int wildcard_filter_stream(
	git_writestream **out,
	git_filter *self,
	void **payload,
	const git_filter_source *src,
	git_writestream *next)
{
	return git_filter_buffered_stream_new(out,
		self, wildcard_filter_apply, NULL, payload, src, next);
}

git_filter_buffered_stream_new is used which is defined in filter.h. filter.h is not in the git2 folder so I thought it is not inteded to be used for the implementation? git_filter_buffered_stream_new needs a function pointer with git_str as arguments which are used normaly internally or?
What is the correct way to replace apply by filter streams?The problem is when I include filter.h in a C++ project it complains that in vector.h the keyword "new" is used as argument:

int git_vector_insert_sorted(git_vector *v, void *element,
	int (*on_dup)(void **old, void *new));
int git_vector_remove(git_vector *v, size_t idx);

@exactly-one-kas
Copy link
Collaborator

As I understand it, git_filter_buffered_stream_new is an internal libgit2 helper and we're supposed to malloc() a new git_writestream ourself (which will be free()'d by libgit2 after use)

Using the QProcess as the payload and hooking up the bytesWritten slot to write into next should work
git_filter.cleanup should then be a simple waiting to flush and delete

@Murmele
Copy link
Owner Author

Murmele commented Oct 6, 2022

self (which will be free()'d by libgit2 after use)

Thanks for the hint. I will check it out next days

target_link_libraries(git git2 Qt5::Core Qt5::Network util)
target_link_libraries(git
$<TARGET_OBJECTS:libgit2>
$<TARGET_OBJECTS:util> # util of libgit2
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this is a good idea - this is an internal part of libgit2 and shouldn't be used by us

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, using git2 instead of libgit2 for target_link_libraries results in CMake trying to use the system-wide installed libgit2, so we should just put libgit2 in here

@Murmele Murmele marked this pull request as ready for review November 17, 2022 15:29
@exactly-one-kas
Copy link
Collaborator

I noticed there are very few differences between our fork and the upstream main branch
Do you think we can use the unmodified version and try to get the changes we need into the official libgit2?

@Murmele
Copy link
Owner Author

Murmele commented Jun 29, 2024

  • Linux Flatpak
  • Linux Appimage: SSH not detected
  • Macos: SSH library not found
  • Windows

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants