Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 2 additions & 2 deletions .github/workflows/codex-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -200,8 +200,8 @@ jobs:
- name: Check out Dugite Native
uses: actions/checkout@v6
with:
repository: desktop/dugite-native
ref: f97e50add48cdcff053a69d95aa343a4a4a258c2
repository: dreynaud-oai/dugite-native
ref: b6f4473557acb85433fdf9deffe0854a34fd9cc5
path: dugite-native
fetch-depth: 0
persist-credentials: false
Expand Down
243 changes: 243 additions & 0 deletions .github/workflows/codex.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,243 @@
name: Refresh codex

on:
schedule:
- cron: '*/5 * * * *'
workflow_dispatch:
inputs:
operation:
description: Refresh, scan, remove, or reorder a pinned topic
type: choice
options:
- refresh
- scan
- remove
- reorder
default: refresh
lane:
description: codex or codex-unstable for a plan operation
required: false
type: string
topic:
description: Exact topic branch for a plan operation
required: false
type: string
after:
description: Existing topic or root for reorder
required: false
type: string
plan_branch:
description: Optional codex-plan/* branch name
required: false
type: string
pull_request_target:
branches:
- meta
types:
- opened
- reopened
- synchronize
- ready_for_review

permissions:
actions: read
contents: read
pull-requests: read

jobs:
refresh:
if: >-
github.event_name == 'workflow_dispatch' &&
github.ref == 'refs/heads/codex' &&
inputs.operation == 'refresh'
uses: openai/git/.github/workflows/codex.yml@meta
topic_plan_scan:
name: Find one approved topic plan
if: >-
github.event_name == 'schedule' ||
(github.event_name == 'workflow_dispatch' &&
github.ref == 'refs/heads/codex' &&
inputs.operation == 'scan')
runs-on: ubuntu-24.04
permissions:
contents: read
pull-requests: read
concurrency:
group: codex-topic-plan-scan
cancel-in-progress: false
outputs:
lane: ${{ steps.reviewed.outputs.lane }}
topic: ${{ steps.reviewed.outputs.topic }}
source_tip: ${{ steps.reviewed.outputs.source_tip }}
review_pr: ${{ steps.reviewed.outputs.review_pr }}
env:
GH_TOKEN: ${{ github.token }}
steps:
- name: Pin trusted meta
id: meta
run: |
set -euo pipefail
test "$GITHUB_REPOSITORY" = openai/git
test "$GITHUB_REF" = refs/heads/codex
sha=$(gh api "repos/$GITHUB_REPOSITORY/git/ref/heads/meta" \
--jq .object.sha)
case "$sha" in
''|*[!0-9a-f]*) exit 1 ;;
esac
test "${#sha}" = 40
printf 'sha=%s\n' "$sha" >>"$GITHUB_OUTPUT"

- name: Check out trusted meta
uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6
with:
repository: ${{ github.repository }}
ref: ${{ steps.meta.outputs.sha }}
fetch-depth: 0
persist-credentials: false

- name: Find one exact approved topic PR
id: reviewed
env:
META_SHA: ${{ steps.meta.outputs.sha }}
run: |
set -euo pipefail

die () {
printf '%s\n' "$*" >&2
exit 1
}

test "$GITHUB_REPOSITORY" = openai/git
test "$GITHUB_REF" = refs/heads/codex ||
die "topic scan must run from the trusted default branch"
test "$(git rev-parse HEAD)" = "$META_SHA" ||
die "trusted checkout does not match pinned meta"
gh auth setup-git
mkdir -p "$RUNNER_TEMP/codex-plan-scan"
for lane in codex codex-unstable
do
case "$lane" in
codex) plan=codex.plan ;;
codex-unstable) plan=codex-unstable.plan ;;
esac
test -f "$plan" ||
die "trusted meta has no $plan"
gh pr list --repo "$GITHUB_REPOSITORY" --state open \
--base "$lane" --limit 1000 \
--json number,isDraft,headRefName,headRefOid,headRepository,reviewDecision |
jq -r --arg lane "$lane" '
.[] |
select(.isDraft | not) |
select(.reviewDecision == "APPROVED") |
select(.headRepository.nameWithOwner == "openai/git") |
[$lane, .headRefName, .headRefOid,
(.number | tostring)] | @tsv
'
done | sort -k4,4n >"$RUNNER_TEMP/codex-plan-scan/candidates"

while IFS=$'\t' read -r lane topic source_tip review_pr
do
test -n "$review_pr" || continue
case "$review_pr" in
*[!0-9]*) die "approved topic PR has invalid number '$review_pr'" ;;
esac
case "$source_tip" in
*[!0-9a-f]*|'') die "approved topic PR has invalid source SHA" ;;
esac
test "${#source_tip}" = 40 ||
die "approved topic PR has invalid source SHA"
git check-ref-format "refs/heads/$topic" >/dev/null 2>&1 ||
die "approved topic PR has invalid branch '$topic'"
case "$topic" in
??/codex/*) ;;
*) continue ;;
esac
suffix=${topic#??/codex/}
case "$suffix" in
''|*/*|*-wip|*-stale) continue ;;
esac
case "$lane" in
codex)
case "$topic" in
*-unstable) continue ;;
esac
plan=codex.plan
;;
codex-unstable)
case "$topic" in
*-unstable) ;;
*) continue ;;
esac
plan=codex-unstable.plan
;;
*) die "approved topic PR has invalid lane '$lane'" ;;
esac
pinned=$(git config --no-includes \
--file "$plan" \
--get "branch.$topic.source-tip" || :)
test "$pinned" = "$source_tip" && continue
short=$(printf '%.12s' "$source_tip")
slug=${topic##*/}
plan_branch=codex-plan/$lane-$slug-$short
pending=$(gh pr list --repo "$GITHUB_REPOSITORY" \
--state open --base meta --head "$plan_branch" \
--json number --jq '.[0].number // empty') ||
die "could not inspect pending Codex plan PR"
test -n "$pending" && continue
if ! sh .github/workflows/codex-branch.sh propose-plan \
--remote origin --lane "$lane" --topic "$topic" \
--action auto --source-tip "$source_tip" \
--review-pr "$review_pr" --expected-meta "$META_SHA" \
--no-push >/dev/null
then
printf 'skipping approved topic PR #%s: preflight failed\n' \
"$review_pr" >&2
continue
fi
{
printf 'lane=%s\n' "$lane"
printf 'topic=%s\n' "$topic"
printf 'source_tip=%s\n' "$source_tip"
printf 'review_pr=%s\n' "$review_pr"
} >>"$GITHUB_OUTPUT"
exit 0
done <"$RUNNER_TEMP/codex-plan-scan/candidates"
topic_plan_propose:
name: Propose reviewed topic plan
needs: topic_plan_scan
if: needs.topic_plan_scan.outputs.review_pr != ''
permissions:
contents: read
pull-requests: read
uses: openai/git/.github/workflows/codex-plan-propose.yml@meta
with:
lane: ${{ needs.topic_plan_scan.outputs.lane }}
topic: ${{ needs.topic_plan_scan.outputs.topic }}
action: auto
source_tip: ${{ needs.topic_plan_scan.outputs.source_tip }}
review_pr: ${{ needs.topic_plan_scan.outputs.review_pr }}
policy_plan_propose:
name: Propose explicit plan policy
if: >-
github.event_name == 'workflow_dispatch' &&
github.ref == 'refs/heads/codex' &&
(inputs.operation == 'remove' || inputs.operation == 'reorder')
permissions:
contents: read
pull-requests: read
uses: openai/git/.github/workflows/codex-plan-propose.yml@meta
with:
lane: ${{ inputs.lane }}
topic: ${{ inputs.topic }}
action: ${{ inputs.operation }}
after: ${{ inputs.after }}
plan_branch: ${{ inputs.plan_branch }}
plan_admission:
name: Codex plan admission
if: >-
github.event_name == 'pull_request_target' &&
github.event.pull_request.base.ref == 'meta'
permissions:
contents: read
pull-requests: write
uses: openai/git/.github/workflows/codex-plan-admission.yml@meta
10 changes: 10 additions & 0 deletions Documentation/config/fetch.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,16 @@ A value of 0 will give some reasonable default. If unset, it defaults to 1.
For submodules, this setting can be overridden using the `submodule.fetchJobs`
config setting.

`fetch.packfileUriJobs`::
Specifies the maximum number of packfile URI downloads and indexers
to run at once. The default is 1, which preserves advertised URI
order.
+
Values greater than 1 are used only when the server advertises and the
client requests the `no-ref-delta` promise. Each URI pack is then checked
with `index-pack --no-ref-delta` before it is accepted.
Responses with one URI retain the serial path.

`fetch.writeCommitGraph`::
Set to true to write a commit-graph after every `git fetch` command
that downloads a pack-file from a remote. Using the `--split` option,
Expand Down
11 changes: 11 additions & 0 deletions Documentation/config/uploadpack.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -86,3 +86,14 @@ uploadpack.allowRefInWant::
is intended for the benefit of load-balanced servers which may
not have the same view of what OIDs their refs point to due to
replication delay.

uploadpack.allowNoRefDelta::
If this option is set, `upload-pack` may advertise the
`no-ref-delta` feature of the protocol version 2 `fetch`
command. When a client requests the feature, `upload-pack` passes
`--no-ref-delta` to `pack-objects` for the inline pack and promises
that every pack named in a `packfile-uris` response section also
contains no `REF_DELTA` entries. `upload-pack` does not inspect
configured URI packs, so the server administrator must create each
pack with `pack-objects --no-ref-delta` or otherwise verify this
property. The default is `false`.
19 changes: 14 additions & 5 deletions Documentation/git-index-pack.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,10 @@ git-index-pack - Build pack index file for an existing packed archive
SYNOPSIS
--------
[verse]
'git index-pack' [-v] [-o <index-file>] [--[no-]rev-index] <pack-file>
'git index-pack' --stdin [--fix-thin] [--keep] [-v] [-o <index-file>]
'git index-pack' [-v] [-o <index-file>] [--no-ref-delta]
[--[no-]rev-index] <pack-file>
'git index-pack' --stdin [--fix-thin] [--keep] [--no-ref-delta]
[-v] [-o <index-file>]
[--[no-]rev-index] [<pack-file>]


Expand Down Expand Up @@ -60,6 +62,11 @@ OPTIONS
excluded objects the deltified objects are based on to the
pack. This option only makes sense in conjunction with --stdin.

--no-ref-delta::
Reject a pack containing a `REF_DELTA` entry. `OFS_DELTA` entries
are accepted. This option can be used to verify a protocol promise
that a pack contains no `REF_DELTA` entries.

--keep::
Before moving the index into its final destination
create an empty .keep file for the associated pack file.
Expand Down Expand Up @@ -100,9 +107,11 @@ default and "Indexing objects" when `--stdin` is specified.
--fsck-objects[=<msg-id>=<severity>...]::
Die if the pack contains broken objects, but unlike `--strict`, don't
choke on broken links. If the pack contains a tree pointing to a
.gitmodules blob that does not exist, prints the hash of that blob
(for the caller to check) after the hash that goes into the name of the
pack/idx file (see "Notes").
.gitmodules or .gitattributes blob that does not exist, prints a record
for that blob (for the caller to check) after the hash that goes into
the name of the pack/idx file (see "Notes"). The record for a
.gitmodules blob is its hash. The record for a .gitattributes blob is
`gitattributes` followed by a space and its hash.
+
An optional comma-separated list of `<msg-id>=<severity>` can be passed to
change the severity of some possible issues, e.g.,
Expand Down
8 changes: 7 additions & 1 deletion Documentation/git-pack-objects.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ SYNOPSIS
--------
[verse]
'git pack-objects' [-q | --progress | --all-progress] [--all-progress-implied]
[--no-reuse-delta] [--delta-base-offset] [--non-empty]
[--no-reuse-delta] [--delta-base-offset] [--no-ref-delta]
[--non-empty]
[--local] [--incremental] [--window=<n>] [--depth=<n>]
[--revs [--unpacked | --all]] [--keep-pack=<pack-name>]
[--cruft] [--cruft-expiration=<time>]
Expand Down Expand Up @@ -297,6 +298,11 @@ Note: Porcelain commands such as `git gc` (see linkgit:git-gc[1]),
in modern Git when they put objects in your repository into pack files.
So does `git bundle` (see linkgit:git-bundle[1]) when it creates a bundle.

--no-ref-delta::
Do not emit deltas which represent their base by their literal
object ID. This is independent of `--delta-base-offset`;
without that option, no deltas are emitted.

--threads=<n>::
Specifies the number of threads to spawn when searching for best
delta matches. This requires that pack-objects be compiled with
Expand Down
21 changes: 18 additions & 3 deletions Documentation/gitprotocol-capabilities.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ were sent. Server MUST NOT ignore capabilities that client requested
and server advertised. As a consequence of these rules, server MUST
NOT advertise capabilities it does not understand.

The 'atomic', 'report-status', 'report-status-v2', 'delete-refs', 'quiet',
and 'push-cert' capabilities are sent and recognized by the receive-pack
(push to server) process.
The 'atomic', 'report-status', 'report-status-v2', 'delete-refs',
'no-ref-delta', 'quiet', and 'push-cert' capabilities are sent and
recognized by the receive-pack (push to server) process.

The 'ofs-delta' and 'side-band-64k' capabilities are sent and recognized
by both upload-pack and receive-pack protocols. The 'agent' and 'session-id'
Expand Down Expand Up @@ -174,6 +174,21 @@ The server can send, and the client can understand, PACKv2 with delta referring
its base by position in pack rather than by an obj-id. That is, they can
send/read OBJ_OFS_DELTA (aka type 6) in a packfile.

no-ref-delta
------------

The receive-pack server can request, and the client can send, PACKv2
without deltas referring to their bases by an obj-id. That is, the
client MUST NOT send OBJ_REF_DELTA (aka type 7) in a packfile when the
server advertises this capability.

This does not imply that the server understands OBJ_OFS_DELTA entries;
that is negotiated separately with the 'ofs-delta' capability.

Protocol v2 `fetch` uses the same name for the corresponding
upload-pack request. There, the promise covers both the inline pack and
any packs named by a `packfile-uris` section.

agent
-----

Expand Down
Loading
Loading