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

Rebase to v2.38.0 #533

Merged
merged 195 commits into from
Oct 5, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
195 commits
Select commit Hold shift + click to select a range
fdd5bc3
reset --stdin: trim carriage return from the paths
Apr 5, 2017
4066df9
gvfs: start by adding the -gvfs suffix to the version
sanoursa Jan 24, 2017
4c87a62
gvfs: ensure that the version is based on a GVFS tag
dscho Apr 4, 2017
48ab0f6
gvfs: add a GVFS-specific header file
Jan 24, 2017
392cd07
gvfs: add the core.gvfs config setting
Jan 24, 2017
10eecbf
gvfs: add the feature to skip writing the index' SHA-1
Jan 24, 2017
104749a
gvfs: add the feature that blobs may be missing
Jan 24, 2017
9994615
gvfs: prevent files to be deleted outside the sparse checkout
May 18, 2016
c4ec7f1
gvfs: add global command pre and post hook procs
May 24, 2016
49fc7fa
t0400: verify that the hook is called correctly from a subdirectory
dscho Mar 16, 2017
30c0603
Pass PID of git process to hooks.
alepauly Apr 10, 2017
0c72508
gvfs: optionally skip reachability checks/upload pack during fetch
May 30, 2016
64fad42
pre-command: always respect core.hooksPath
dscho Aug 7, 2017
9b65a27
gvfs: ensure all filters and EOL conversions are blocked
Jun 15, 2016
7cb57ff
sparse-checkout: update files with a modify/delete conflict
Feb 22, 2017
5be734d
gvfs: allow "virtualizing" objects
Jan 10, 2017
a3a72ae
sparse-checkout: avoid writing entries with the skip-worktree bit
Mar 1, 2017
1545073
Hydrate missing loose objects in check_and_freshen()
Mar 15, 2017
9bbd1f2
Do not remove files outside the sparse-checkout
Apr 5, 2017
67aacdc
sha1_file: when writing objects, skip the read_object_hook
dscho Sep 8, 2017
7c8003f
Add virtual file system settings and hook proc
benpeart Jan 11, 2018
d8ed72d
gvfs: refactor loading the core.gvfs config value
Apr 14, 2017
311056b
virtualfilesystem: don't run the virtual file system hook if the inde…
benpeart Aug 1, 2018
f75a973
send-pack: do not check for sha1 file when GVFS_MISSING_OK set
Nov 16, 2018
adf8d28
virtualfilesystem: fix bug with symlinks being ignored
benpeart Sep 25, 2018
330d7cc
cache-tree: remove use of strbuf_addf in update_one
Jul 3, 2017
ec9cab4
virtualfilesystem: check if directory is included
Oct 9, 2018
0aa5176
gvfs: block unsupported commands when running in a GVFS repo
benpeart Dec 6, 2018
a2fc365
vfs: fix case where directories not handled correctly
jamill Nov 20, 2018
ec23ff5
gvfs: allow overriding core.gvfs
derrickstolee Apr 15, 2020
e173645
backwards-compatibility: support the post-indexchanged hook
dscho May 28, 2019
0a56d43
BRANCHES.md: Add explanation of branches and using forks
Jul 27, 2018
55107ff
status: add status serialization mechanism
jeffhostetler Aug 22, 2017
120dcdc
Teach ahead-behind and serialized status to play nicely together
jamill Jan 10, 2018
5e6c864
status: serialize to path
jeffhostetler Feb 2, 2018
57608af
status: reject deserialize in V2 and conflicts
jeffhostetler Feb 7, 2018
cd66962
status: fix rename reporting when using serialization cache
jeffhostetler Jul 25, 2018
bdcb4ed
serialize-status: serialize global and repo-local exclude file metadata
jeffhostetler Jul 20, 2018
e0e545b
status: deserialization wait
jeffhostetler Jul 25, 2018
e908821
merge-recursive: avoid confusing logic in was_dirty()
dscho May 21, 2019
bc85f64
merge-recursive: add some defensive coding to was_dirty()
dscho May 21, 2019
8c0f874
merge-recursive: teach was_dirty() about the virtualfilesystem
dscho May 21, 2019
82e752d
status: deserialize with -uno does not print correct hint
jeffhostetler Jun 25, 2019
b85984b
gvfs: verify that the built-in FSMonitor is disabled
dscho Jun 18, 2021
5be25c0
gvfs:trace2:data: add trace2 tracing around read_object_process
jeffhostetler Sep 26, 2018
e73f7a5
gvfs:trace2:data: status deserialization information
jeffhostetler Sep 26, 2018
1329929
wt-status-deserialize: fix crash when -v is used
jeffhostetler Apr 10, 2020
dc8c9e1
gvfs:trace2:data: status serialization
jeffhostetler Jan 7, 2019
c7079a8
fsmonitor: check CE_FSMONITOR_VALID in ce_uptodate
kewillford Nov 21, 2019
7512940
gvfs:trace2:data: add vfs stats
jeffhostetler Nov 19, 2018
7b47f2e
fsmonitor: add script for debugging and update script for tests
kewillford Nov 21, 2019
3f3fd92
trace2: refactor setting process starting time
jeffhostetler Apr 15, 2019
bdfbedd
status: disable deserialize when verbose output requested.
jeffhostetler Apr 11, 2020
75e8ab3
trace2:gvfs:experiment: clear_ce_flags_1
jeffhostetler Apr 30, 2019
b611029
t7524: add test for verbose status deserialzation
jeffhostetler Apr 11, 2020
87a6088
trace2:gvfs:experiment: report_tracking
jeffhostetler Apr 30, 2019
3be96c8
deserialize-status: silently fallback if we cannot read cache file
jeffhostetler May 13, 2020
4ed87f0
trace2:gvfs:experiment: read_cache: annotate thread usage in read-cache
jeffhostetler Jun 14, 2019
e9cdc5e
trace2:gvfs:experiment: read-cache: time read/write of cache-tree ext…
jeffhostetler Jul 9, 2019
2bcce0f
cache-tree: use `r` instead of `the_repository` in Trace2
jeffhostetler Jun 3, 2019
fe5bbf9
trace2:gvfs:experiment: add region to apply_virtualfilesystem()
jeffhostetler Jul 16, 2019
f82f3ba
trace2:gvfs:experiment: add region around unpack_trees()
jeffhostetler Jul 16, 2019
f260b6b
trace2:gvfs:experiment: add region to cache_tree_fully_valid()
jeffhostetler Jul 16, 2019
80612f7
credential: set trace2_child_class for credential manager children
jeffhostetler Oct 3, 2019
a011d7b
trace2:gvfs:experiment: add unpack_entry() counter to unpack_trees() …
jeffhostetler Jul 16, 2019
ba56834
sub-process: do not borrow cmd pointer from caller
jeffhostetler Sep 18, 2019
752356d
trace2:gvfs:experiment: increase default event depth for unpack-tree …
jeffhostetler Jul 25, 2019
56a974b
sub-process: add subprocess_start_argv()
jeffhostetler Sep 18, 2019
a3e4a0a
trace2:gvfs:experiment: add data for check_updates() in unpack_trees()
jeffhostetler Jul 25, 2019
348694f
sha1-file: add function to update existing loose object cache
jeffhostetler Sep 24, 2019
d447ded
Trace2:gvfs:experiment: capture more 'tracking' details
jeffhostetler Jul 26, 2019
5876f3c
packfile: add install_packed_git_and_mru()
jeffhostetler Sep 25, 2019
d8f7578
index-pack: avoid immediate object fetch while parsing packfile
jeffhostetler Sep 24, 2019
8c7b432
gvfs-helper: create tool to fetch objects using the GVFS Protocol
jeffhostetler Aug 13, 2019
d3c58d3
gvfs-helper: fix race condition when creating loose object dirs
derrickstolee Oct 4, 2019
14feaa2
sha1-file: create shared-cache directory if it doesn't exist
jeffhostetler Oct 7, 2019
3a63a54
gvfs-helper: better handling of network errors
jeffhostetler Oct 8, 2019
0a8efd9
gvfs-helper-client: properly update loose cache with fetched OID
jeffhostetler Oct 8, 2019
cdc13e8
gvfs-helper: V2 robust retry and throttling
jeffhostetler Oct 10, 2019
b86b391
gvfs-helper: expose gvfs/objects GET and POST semantics
jeffhostetler Oct 21, 2019
58f2896
gvfs-helper: dramatically reduce progress noise
derrickstolee Oct 24, 2019
b02d0fa
gvfs-helper-client.h: define struct object_id
derrickstolee Nov 4, 2019
75f5200
gvfs-helper: handle pack-file after single POST request
derrickstolee Nov 11, 2019
84504b0
gvfs-helper: add prefetch support
jeffhostetler Nov 11, 2019
e06d9d3
test-gvfs-prococol, t5799: tests for gvfs-helper
jeffhostetler Oct 25, 2019
cd7fa3f
gvfs-helper: add prefetch .keep file for last packfile
jeffhostetler Nov 26, 2019
3bf9b4c
gvfs-helper: move result-list construction into install functions
jeffhostetler Nov 13, 2019
c97aed8
gvfs-helper: do one read in my_copy_fd_len_tail()
derrickstolee Dec 16, 2019
34a6ad1
t5799: add support for POST to return either a loose object or packfile
jeffhostetler Nov 13, 2019
4213eab
gvfs-helper: move content-type warning for prefetch packs
derrickstolee Dec 16, 2019
ac19c4e
t5799: cleanup wc-l and grep-c lines
jeffhostetler Nov 13, 2019
95688b4
fetch: use gvfs-helper prefetch under config
derrickstolee Dec 17, 2019
c3eb9d0
gvfs-helper: verify loose objects after write
derrickstolee Sep 18, 2020
b1e5078
gvfs-helper: better support for concurrent packfile fetches
jeffhostetler Dec 18, 2019
a264938
t7599: create corrupt blob test
jeffhostetler Sep 18, 2020
056cb2b
remote-curl: do not call fetch-pack when using gvfs-helper
derrickstolee Feb 3, 2020
2d199bb
fetch: reprepare packs before checking connectivity
derrickstolee Mar 12, 2020
8e063f0
homebrew: add GitHub workflow to release Cask
mjcheetham Jul 24, 2020
042ad77
gvfs-helper: retry when creating temp files
derrickstolee Dec 26, 2019
ee94f47
Adding winget workflows
Apr 29, 2021
0b053ae
sparse: avoid warnings about known cURL issues in gvfs-helper.c
derrickstolee Aug 3, 2021
8dc7ade
upload-pack: fix race condition in error messages
derrickstolee Aug 27, 2019
809830a
maintenance: care about gvfs.sharedCache config
derrickstolee Dec 15, 2020
3e1965a
unpack-trees:virtualfilesystem: Improve efficiency of clear_ce_flags
neerajsi-msft2 Feb 6, 2021
25a6934
Add workflow for apt-get release
dscho Jun 25, 2021
9f43036
Disable the `monitor-components` workflow in msft-git
dscho May 13, 2022
3df2647
release: create initial Windows installer build workflow
vdye Jul 16, 2021
af6c455
release: add Mac OSX installer build
vdye Jul 16, 2021
daa6a6c
release: build unsigned Ubuntu .deb package
vdye Jul 16, 2021
127afc3
Makefile: allow specifying GIT_BUILT_FROM_COMMIT
vdye Nov 30, 2021
12a48f8
release: add signing step for .deb package
vdye Jul 16, 2021
8f9824f
dist: archive HEAD instead of HEAD^{tree}
vdye Dec 2, 2021
747e2fb
update-microsoft-git: create barebones builtin
derrickstolee Apr 29, 2021
0dd15e7
release: create draft GitHub release with packages & installers
vdye Jul 16, 2021
5d340d8
release: include GIT_BUILT_FROM_COMMIT in MacOS build
vdye Dec 2, 2021
d2cbb1a
update-microsoft-git: Windows implementation
derrickstolee Apr 29, 2021
21875a0
release: continue pestering until user upgrades
derrickstolee Oct 6, 2021
d574cc9
release: add installer validation
ldennington Aug 17, 2022
a98883a
.github: update ISSUE_TEMPLATE.md for microsoft/git
derrickstolee Mar 16, 2022
15f9689
git_config_set_multivar_in_file_gently(): add a lock timeout
dscho May 18, 2021
b03751d
.github: update PULL_REQUEST_TEMPLATE.md
derrickstolee Mar 16, 2022
93c7e1b
maintenance: make unregister idempotent
derrickstolee Sep 19, 2022
6b9c00b
scalar: set the config write-lock timeout to 150ms
dscho May 18, 2021
102f0ed
update-microsoft-git: use brew on macOS
derrickstolee Apr 29, 2021
2527e85
Adjust README.md for microsoft/git
May 4, 2021
564bf9c
Merge branch 'derrickstolee/maintenance-unregister'
dscho Sep 19, 2022
be38bf1
scalar: add docs from microsoft/scalar
derrickstolee Jun 16, 2021
51dddde
Merge branch 'scalar-gentler-config-locking'
dscho May 19, 2021
7345688
Merge branch 'scalar-extra-docs'
dscho Nov 16, 2021
27c77cd
scalar (Windows): use forward slashes as directory separators
dscho May 10, 2022
435aeee
scalar: add retry logic to run_git()
derrickstolee Jun 17, 2021
cf55796
scalar: support the `config` command for backwards compatibility
dscho May 27, 2021
6bfcbc9
Merge branch 'microsoft/vfs-2.35.0'
dscho Oct 7, 2021
6234615
Merge branch 'scalar'
dscho Aug 24, 2021
be87857
add/rm: allow adding sparse entries when virtual
derrickstolee Jun 29, 2021
7779115
sparse-checkout: add config to disable deleting dirs
derrickstolee Aug 22, 2021
279752f
diff: ignore sparse paths in diffstat
derrickstolee Jul 26, 2021
fde044a
Merge pull request #392: add: allow adding sparse entries when virtual
derrickstolee Jul 1, 2021
10a4e6d
Merge branch 'sparse-index/merge' into vfs-2.33.0
derrickstolee Aug 24, 2021
3b6edb8
repo-settings: enable sparse index by default
derrickstolee Jun 15, 2021
1ab6439
Merge pull request #410: Sparse Index: latest integrations
derrickstolee Aug 24, 2021
7dfcc54
diff(sparse-index): verify with partially-sparse
ldennington Sep 10, 2021
dab75a5
Merge pull request #414: Make sparse index the default
derrickstolee Aug 26, 2021
e5e9d7c
stash: expand testing for `git stash -u`
vdye Sep 22, 2021
5af4466
Merge pull request #419 from ldennington/sparse-index-diff
ldennington Sep 12, 2021
bac7131
sequencer: avoid progress when stderr is redirected
derrickstolee Sep 23, 2021
a828e69
Merge pull request #430 from vdye/sparse-index/clean
vdye Sep 23, 2021
9c75abf
Merge pull request #432: sequencer: avoid progress when stderr is red…
derrickstolee Sep 23, 2021
e1d605d
maintenance: delete stale lock files
derrickstolee Nov 16, 2021
d66465e
sparse: add vfs-specific precautions
derrickstolee Oct 31, 2021
b3b0d1c
Merge pull request #468: maintenance: delete stale lock files, fix lo…
derrickstolee Nov 16, 2021
48de480
reset: fix mixed reset when using virtual filesystem
Mar 15, 2017
72a5c13
Merge core VFS features
dscho Jun 11, 2018
4a1c14f
Merge pull request #494: reset: fix mixed reset when using virtual fi…
derrickstolee Apr 4, 2022
ff3d431
Merge advanced VFS-specific features
dscho Jun 11, 2018
e261395
Merge virtualfilesystem hook
dscho Jun 11, 2018
f155bca
Merge updates to serialized status
dscho Jun 11, 2018
189b906
Merge trace2 experimental regions
jeffhostetler Apr 23, 2019
ebcbccf
Merge first wave of gvfs-helper feature
jeffhostetler Nov 14, 2019
92d6f25
Merge gvfs-helper prefetch feature
derrickstolee Dec 17, 2019
1fac7be
Merge upstreamable patches
dscho Oct 18, 2018
a3f1f70
Merge pull request #301: Update 'git maintenance' to match upstream
derrickstolee Dec 15, 2020
ff8123b
Merge pull request #315: unpack-trees:virtualfilesystem: Improve effi…
derrickstolee Feb 16, 2021
a98538d
Merge branch 'add-workflows'
derrickstolee Apr 30, 2021
4d838f6
Merge pull request #502 from dscho/disable-monitor-components
dscho May 13, 2022
8545373
Merge pull request #399 from vdye/feature/build-installers
vdye Jul 29, 2021
29c0630
Merge pull request #472 from vdye/ms/macos-build-options
vdye Dec 6, 2021
7b6d380
Merge pull request #329: Add `git update-microsoft-git`
derrickstolee Apr 30, 2021
68c697f
Merge pull request #333: update microsoft/git README
derrickstolee May 17, 2021
8a07593
scalar: implement a minimal JSON parser
dscho Apr 26, 2021
2a31739
scalar clone: support GVFS-enabled remote repositories
dscho Aug 24, 2021
43da238
test-gvfs-protocol: also serve smart protocol
dscho Apr 16, 2021
986e70a
gvfs-helper: add the `endpoint` command
dscho Apr 26, 2021
392ec51
dir_inside_of(): handle directory separators correctly
dscho May 14, 2021
13601c0
scalar: disable authentication in unattended mode
dscho May 6, 2021
3d24fa0
scalar: do initialize `gvfs.sharedCache`
dscho May 3, 2021
dd32726
scalar diagnose: include shared cache info
dscho Jun 1, 2021
e8e1ccd
scalar: only try GVFS protocol on https:// URLs
dscho Apr 28, 2021
34c7005
scalar: verify that we can use a GVFS-enabled repository
dscho Apr 16, 2021
8b6c934
scalar: add the `cache-server` command
dscho Apr 23, 2021
35399e2
scalar: add a test toggle to skip accessing the vsts/info endpoint
dscho May 12, 2021
3c9f070
scalar: adjust documentation to the microsoft/git fork
dscho Jan 25, 2022
7dd5eee
scalar: enable untracked cache unconditionally
derrickstolee Jun 21, 2021
2f982c5
scalar diagnose: accommodate Scalar's Functional Tests
dscho May 9, 2022
d2ecb32
scalar: parse `clone --no-fetch-commits-and-trees` for backwards comp…
dscho Aug 24, 2021
cd6bb91
ci: run Scalar's Functional Tests
dscho Jun 8, 2021
d92d005
Merge branch 'scalar-with-gvfs'
dscho May 3, 2021
417393e
setup: add discover_git_directory_reason()
derrickstolee May 24, 2022
ad8b522
scalar: upgrade to newest FSMonitor config setting
vdye Apr 5, 2022
08570d0
Merge branch 'run-scalar-functional-tests'
dscho Nov 16, 2021
288400b
scalar reconfigure: help users remove buggy repos
derrickstolee May 23, 2022
3d87b36
Merge branch 'scalar-reconfigure'
dscho Jun 1, 2021
f36578e
Merge pull request #508: scalar reconfigure: help users remove buggy …
derrickstolee May 31, 2022
9bb1dab
Merge pull request #371 from dscho/run-scalar-functional-tests-and-fi…
dscho Jun 9, 2021
96d6fe3
Merge branch 'sparse-index-stuff'
dscho Jun 17, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 19 additions & 15 deletions .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,33 +1,33 @@
- [ ] I was not able to find an [open](https://github.com/git-for-windows/git/issues?q=is%3Aopen) or [closed](https://github.com/git-for-windows/git/issues?q=is%3Aclosed) issue matching what I'm seeing
- [ ] I was not able to find an [open](https://github.com/microsoft/git/issues?q=is%3Aopen)
or [closed](https://github.com/microsoft/git/issues?q=is%3Aclosed) issue matching
what I'm seeing, including in [the `git-for-windows/git` tracker](https://github.com/git-for-windows/git/issues).

### Setup

- Which version of Git for Windows are you using? Is it 32-bit or 64-bit?
- Which version of `microsoft/git` are you using? Is it 32-bit or 64-bit?

```
$ git --version --build-options
** insert your machine's response here **
```

- Which version of Windows are you running? Vista, 7, 8, 10? Is it 32-bit or 64-bit?
Are you using Scalar or VFS for Git?

** insert your answer here **

If VFS for Git, then what version?

```
$ cmd.exe /c ver
$ gvfs version
** insert your machine's response here **
```

- What options did you set as part of the installation? Or did you choose the
defaults?
- Which version of Windows are you running? Vista, 7, 8, 10? Is it 32-bit or 64-bit?

```
# One of the following:
> type "C:\Program Files\Git\etc\install-options.txt"
> type "C:\Program Files (x86)\Git\etc\install-options.txt"
> type "%USERPROFILE%\AppData\Local\Programs\Git\etc\install-options.txt"
> type "$env:USERPROFILE\AppData\Local\Programs\Git\etc\install-options.txt"
$ cat /etc/install-options.txt
$ cmd.exe /c ver
** insert your machine's response here **
```
Expand Down Expand Up @@ -58,7 +58,11 @@ $ cat /etc/install-options.txt

** insert here **

- If the problem was occurring with a specific repository, can you provide the
URL to that repository to help us with testing?
- If the problem was occurring with a specific repository, can you specify
the repository?

** insert URL here **
* [ ] Public repo: **insert URL here**
* [ ] Windows monorepo
* [ ] Office monorepo
* [ ] Other Microsoft-internal repo: **insert name here**
* [ ] Other internal repo.
25 changes: 8 additions & 17 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,10 @@
Thanks for taking the time to contribute to Git!

Those seeking to contribute to the Git for Windows fork should see
http://gitforwindows.org/#contribute on how to contribute Windows specific
enhancements.

If your contribution is for the core Git functions and documentation
please be aware that the Git community does not use the github.com issues
or pull request mechanism for their contributions.

Instead, we use the Git mailing list (git@vger.kernel.org) for code and
documentation submissions, code reviews, and bug reports. The
mailing list is plain text only (anything with HTML is sent directly
to the spam folder).

Nevertheless, you can use GitGitGadget (https://gitgitgadget.github.io/)
to conveniently send your Pull Requests commits to our mailing list.

Please read the "guidelines for contributing" linked above!
This fork contains changes specific to monorepo scenarios. If you are an
external contributor, then please detail your reason for submitting to
this fork:

* [ ] This is an early version of work already under review upstream.
* [ ] This change only applies to interactions with Azure DevOps and the
GVFS Protocol.
* [ ] This change only applies to the virtualization hook and VFS for Git.
116 changes: 116 additions & 0 deletions .github/macos-installer/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
SHELL := /bin/bash
SUDO := sudo
C_INCLUDE_PATH := /usr/include
CPLUS_INCLUDE_PATH := /usr/include
LD_LIBRARY_PATH := /usr/lib

OSX_VERSION := $(shell sw_vers -productVersion)
TARGET_FLAGS := -mmacosx-version-min=$(OSX_VERSION) -DMACOSX_DEPLOYMENT_TARGET=$(OSX_VERSION)

ARCH := x86_64
ARCH_CODE := x86_64
ARCH_FLAGS_x86_64 := -arch x86_64

CFLAGS := $(TARGET_FLAGS) $(ARCH_FLAGS_${ARCH_CODE})
LDFLAGS := $(TARGET_FLAGS) $(ARCH_FLAGS_${ARCH_CODE})

PREFIX := /usr/local
GIT_PREFIX := $(PREFIX)/git

BUILD_CODE := intel-$(ARCH_CODE)
BUILD_DIR := $(GITHUB_WORKSPACE)/payload
DESTDIR := $(PWD)/stage/git-$(BUILD_CODE)-$(VERSION)
ARTIFACTDIR := build_artifacts
SUBMAKE := $(MAKE) C_INCLUDE_PATH="$(C_INCLUDE_PATH)" CPLUS_INCLUDE_PATH="$(CPLUS_INCLUDE_PATH)" LD_LIBRARY_PATH="$(LD_LIBRARY_PATH)" TARGET_FLAGS="$(TARGET_FLAGS)" CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" NO_GETTEXT=1 NO_DARWIN_PORTS=1 prefix=$(GIT_PREFIX) GIT_BUILT_FROM_COMMIT="$(GIT_BUILT_FROM_COMMIT)" DESTDIR=$(DESTDIR)
CORES := $(shell bash -c "sysctl hw.ncpu | awk '{print \$$2}'")

.PHONY: image pkg payload

.SECONDARY:

$(DESTDIR)$(GIT_PREFIX)/VERSION-$(VERSION)-$(BUILD_CODE):
rm -f $(BUILD_DIR)/git-$(VERSION)/osx-installed*
mkdir -p $(DESTDIR)$(GIT_PREFIX)
touch $@

$(BUILD_DIR)/git-$(VERSION)/osx-built-keychain:
cd $(BUILD_DIR)/git-$(VERSION)/contrib/credential/osxkeychain; $(SUBMAKE) CFLAGS="$(CFLAGS) -g -O2 -Wall"
touch $@

$(BUILD_DIR)/git-$(VERSION)/osx-built:
[ -d $(DESTDIR)$(GIT_PREFIX) ] && $(SUDO) rm -rf $(DESTDIR) || echo ok
cd $(BUILD_DIR)/git-$(VERSION); $(SUBMAKE) -j $(CORES) all strip
touch $@

$(BUILD_DIR)/git-$(VERSION)/osx-installed-bin: $(BUILD_DIR)/git-$(VERSION)/osx-built $(BUILD_DIR)/git-$(VERSION)/osx-built-keychain
cd $(BUILD_DIR)/git-$(VERSION); $(SUBMAKE) install
cp $(BUILD_DIR)/git-$(VERSION)/contrib/credential/osxkeychain/git-credential-osxkeychain $(DESTDIR)$(GIT_PREFIX)/bin/git-credential-osxkeychain
mkdir -p $(DESTDIR)$(GIT_PREFIX)/contrib/completion
cp $(BUILD_DIR)/git-$(VERSION)/contrib/completion/git-completion.bash $(DESTDIR)$(GIT_PREFIX)/contrib/completion/
cp $(BUILD_DIR)/git-$(VERSION)/contrib/completion/git-completion.zsh $(DESTDIR)$(GIT_PREFIX)/contrib/completion/
cp $(BUILD_DIR)/git-$(VERSION)/contrib/completion/git-prompt.sh $(DESTDIR)$(GIT_PREFIX)/contrib/completion/
# This is needed for Git-Gui, GitK
mkdir -p $(DESTDIR)$(GIT_PREFIX)/lib/perl5/site_perl
[ ! -f $(DESTDIR)$(GIT_PREFIX)/lib/perl5/site_perl/Error.pm ] && cp $(BUILD_DIR)/git-$(VERSION)/perl/private-Error.pm $(DESTDIR)$(GIT_PREFIX)/lib/perl5/site_perl/Error.pm || echo done
touch $@

$(BUILD_DIR)/git-$(VERSION)/osx-installed-man: $(BUILD_DIR)/git-$(VERSION)/osx-installed-bin
mkdir -p $(DESTDIR)$(GIT_PREFIX)/share/man
cp -R $(GITHUB_WORKSPACE)/manpages/ $(DESTDIR)$(GIT_PREFIX)/share/man
touch $@

$(BUILD_DIR)/git-$(VERSION)/osx-built-subtree:
cd $(BUILD_DIR)/git-$(VERSION)/contrib/subtree; $(SUBMAKE) XML_CATALOG_FILES="$(XML_CATALOG_FILES)" all git-subtree.1
touch $@

$(BUILD_DIR)/git-$(VERSION)/osx-installed-subtree: $(BUILD_DIR)/git-$(VERSION)/osx-built-subtree
mkdir -p $(DESTDIR)
cd $(BUILD_DIR)/git-$(VERSION)/contrib/subtree; $(SUBMAKE) XML_CATALOG_FILES="$(XML_CATALOG_FILES)" install install-man
touch $@

$(BUILD_DIR)/git-$(VERSION)/osx-installed-assets: $(BUILD_DIR)/git-$(VERSION)/osx-installed-bin
mkdir -p $(DESTDIR)$(GIT_PREFIX)/etc
cat assets/etc/gitconfig.osxkeychain >> $(DESTDIR)$(GIT_PREFIX)/etc/gitconfig
cp assets/uninstall.sh $(DESTDIR)$(GIT_PREFIX)/uninstall.sh
sh -c "echo .DS_Store >> $(DESTDIR)$(GIT_PREFIX)/share/git-core/templates/info/exclude"

symlinks:
mkdir -p $(ARTIFACTDIR)$(PREFIX)/bin
cd $(ARTIFACTDIR)$(PREFIX)/bin; find ../git/bin -type f -exec ln -sf {} \;
for man in man1 man3 man5 man7; do mkdir -p $(ARTIFACTDIR)$(PREFIX)/share/man/$$man; (cd $(ARTIFACTDIR)$(PREFIX)/share/man/$$man; ln -sf ../../../git/share/man/$$man/* ./); done
ruby ../scripts/symlink-git-hardlinks.rb $(ARTIFACTDIR)
touch $@

$(BUILD_DIR)/git-$(VERSION)/osx-installed: $(DESTDIR)$(GIT_PREFIX)/VERSION-$(VERSION)-$(BUILD_CODE) $(BUILD_DIR)/git-$(VERSION)/osx-installed-man $(BUILD_DIR)/git-$(VERSION)/osx-installed-assets $(BUILD_DIR)/git-$(VERSION)/osx-installed-subtree
find $(DESTDIR)$(GIT_PREFIX) -type d -exec chmod ugo+rx {} \;
find $(DESTDIR)$(GIT_PREFIX) -type f -exec chmod ugo+r {} \;
touch $@

$(BUILD_DIR)/git-$(VERSION)/osx-built-assert-$(ARCH_CODE): $(BUILD_DIR)/git-$(VERSION)/osx-built
ifeq ("$(ARCH_CODE)", "universal")
File $(BUILD_DIR)/git-$(VERSION)/git
File $(BUILD_DIR)/git-$(VERSION)/contrib/credential/osxkeychain/git-credential-osxkeychain
else
[ "$$(File $(BUILD_DIR)/git-$(VERSION)/git | cut -f 5 -d' ')" == "$(ARCH_CODE)" ]
[ "$$(File $(BUILD_DIR)/git-$(VERSION)/contrib/credential/osxkeychain/git-credential-osxkeychain | cut -f 5 -d' ')" == "$(ARCH_CODE)" ]
endif
touch $@

disk-image/VERSION-$(VERSION)-$(ARCH_CODE):
rm -f disk-image/*.pkg disk-image/VERSION-* disk-image/.DS_Store
mkdir disk-image
touch "$@"

disk-image/git-$(VERSION)-$(BUILD_CODE).pkg: disk-image/VERSION-$(VERSION)-$(ARCH_CODE) symlinks
pkgbuild --identifier com.git.pkg --version $(VERSION) --root $(ARTIFACTDIR)$(PREFIX) --scripts assets/scripts --install-location $(PREFIX) --component-plist ./assets/git-components.plist disk-image/git-$(VERSION)-$(BUILD_CODE).pkg

git-%-$(BUILD_CODE).dmg:
hdiutil create git-$(VERSION)-$(BUILD_CODE).uncompressed.dmg -fs HFS+ -srcfolder disk-image -volname "Git $(VERSION) Intel $(ARCH)" -ov
hdiutil convert -format UDZO -o $@ git-$(VERSION)-$(BUILD_CODE).uncompressed.dmg
rm -f git-$(VERSION)-$(BUILD_CODE).uncompressed.dmg

payload: $(BUILD_DIR)/git-$(VERSION)/osx-installed $(BUILD_DIR)/git-$(VERSION)/osx-built-assert-$(ARCH_CODE)

pkg: disk-image/git-$(VERSION)-$(BUILD_CODE).pkg

image: git-$(VERSION)-$(BUILD_CODE).dmg
2 changes: 2 additions & 0 deletions .github/macos-installer/assets/etc/gitconfig.osxkeychain
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[credential]
helper = osxkeychain
18 changes: 18 additions & 0 deletions .github/macos-installer/assets/git-components.plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<array>
<dict>
<key>BundleHasStrictIdentifier</key>
<true/>
<key>BundleIsRelocatable</key>
<false/>
<key>BundleIsVersionChecked</key>
<true/>
<key>BundleOverwriteAction</key>
<string>upgrade</string>
<key>RootRelativeBundlePath</key>
<string>git/share/git-gui/lib/Git Gui.app</string>
</dict>
</array>
</plist>
62 changes: 62 additions & 0 deletions .github/macos-installer/assets/scripts/postinstall
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
#!/bin/bash
INSTALL_DST="$2"
SCALAR_C_CMD="$INSTALL_DST/git/bin/scalar"
SCALAR_DOTNET_CMD="/usr/local/scalar/scalar"
SCALAR_UNINSTALL_SCRIPT="/usr/local/scalar/uninstall_scalar.sh"

function cleanupScalar()
{
echo "checking whether Scalar was installed"
if [ ! -f "$SCALAR_C_CMD" ]; then
echo "Scalar not installed; exiting..."
return 0
fi
echo "Scalar is installed!"

echo "looking for Scalar.NET"
if [ ! -f "$SCALAR_DOTNET_CMD" ]; then
echo "Scalar.NET not found; exiting..."
return 0
fi
echo "Scalar.NET found!"

currentUser=$(echo "show State:/Users/ConsoleUser" | scutil | awk '/Name :/ { print $3 }')

# Re-register Scalar.NET repositories with the newly-installed Scalar
for repo in $($SCALAR_DOTNET_CMD list); do
(
PATH="$INSTALL_DST/git/bin:$PATH"
sudo -u "$currentUser" scalar register $repo || \
echo "warning: skipping re-registration of $repo"
)
done

# Uninstall Scalar.NET
echo "removing Scalar.NET"

# Add /usr/local/bin to path - default install location of Homebrew
PATH="/usr/local/bin:$PATH"
if (sudo -u "$currentUser" brew list --cask scalar); then
# Remove from Homebrew
sudo -u "$currentUser" brew remove --cask scalar || echo "warning: Scalar.NET uninstall via Homebrew completed with code $?"
echo "Scalar.NET uninstalled via Homebrew!"
elif (sudo -u "$currentUser" brew list --cask scalar-azrepos); then
sudo -u "$currentUser" brew remove --cask scalar-azrepos || echo "warning: Scalar.NET with GVFS uninstall via Homebrew completed with code $?"
echo "Scalar.NET with GVFS uninstalled via Homebrew!"
elif [ -f $SCALAR_UNINSTALL_SCRIPT ]; then
# If not installed with Homebrew, manually remove package
sudo -S sh $SCALAR_UNINSTALL_SCRIPT || echo "warning: Scalar.NET uninstall completed with code $?"
echo "Scalar.NET uninstalled!"
else
echo "warning: Scalar.NET uninstall script not found"
fi

# Re-create the Scalar symlink, in case it was removed by the Scalar.NET uninstall operation
mkdir -p $INSTALL_DST/bin
/bin/ln -Fs "$SCALAR_C_CMD" "$INSTALL_DST/bin/scalar"
}

# Run Scalar cleanup (will exit if not applicable)
cleanupScalar

exit 0
34 changes: 34 additions & 0 deletions .github/macos-installer/assets/uninstall.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#!/bin/bash -e
if [ ! -r "/usr/local/git" ]; then
echo "Git doesn't appear to be installed via this installer. Aborting"
exit 1
fi

if [ "$1" != "--yes" ]; then
echo "This will uninstall git by removing /usr/local/git/, and symlinks"
printf "Type 'yes' if you are sure you wish to continue: "
read response
else
response="yes"
fi

if [ "$response" == "yes" ]; then
# remove all of the symlinks we've created
pkgutil --files com.git.pkg | grep bin | while read f; do
if [ -L /usr/local/$f ]; then
sudo rm /usr/local/$f
fi
done

# forget receipts.
pkgutil --packages | grep com.git.pkg | xargs -I {} sudo pkgutil --forget {}
echo "Uninstalled"

# The guts all go here.
sudo rm -rf /usr/local/git/
else
echo "Aborted"
exit 1
fi

exit 0
Loading