Skip to content

Commit bb36868

Browse files
committed
VSI Git 2.44-1B
1 parent 2000d4c commit bb36868

File tree

306 files changed

+14396
-111
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

306 files changed

+14396
-111
lines changed

Documentation/Makefile

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -145,16 +145,17 @@ man5dir = $(mandir)/man5
145145
man7dir = $(mandir)/man7
146146
# DESTDIR =
147147

148-
GIT_DATE := $(shell git show --quiet --pretty='%as')
148+
# This is a temporary. It will work once the make process functions correctly.
149+
# GIT_DATE := $(shell git show --quiet --pretty='%as')
149150

150151
ASCIIDOC = asciidoc
151152
ASCIIDOC_EXTRA =
152153
ASCIIDOC_HTML = xhtml11
153154
ASCIIDOC_DOCBOOK = docbook
154155
ASCIIDOC_CONF = -f asciidoc.conf
155156
ASCIIDOC_COMMON = $(ASCIIDOC) $(ASCIIDOC_EXTRA) $(ASCIIDOC_CONF) \
156-
-amanmanual='Git Manual' -amansource='Git $(GIT_VERSION)' \
157-
-arevdate='$(GIT_DATE)'
157+
-amanmanual='Git Manual' -amansource='Git $(GIT_VERSION)'
158+
# -arevdate='$(GIT_DATE)'
158159
ASCIIDOC_DEPS = asciidoc.conf GIT-ASCIIDOCFLAGS
159160
TXT_TO_HTML = $(ASCIIDOC_COMMON) -b $(ASCIIDOC_HTML)
160161
TXT_TO_XML = $(ASCIIDOC_COMMON) -b $(ASCIIDOC_DOCBOOK)

GIT-VERSION-GEN

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@
33
GVF=GIT-VERSION-FILE
44
DEF_VER=v2.44.0
55

6+
if [ "$1" = "OpenVMS" ]; then
7+
GVF=GIT-VERSION-FILE-VMS
8+
fi
9+
610
LF='
711
'
812

abspath.c

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,8 +124,11 @@ static char *strbuf_realpath_1(struct strbuf *resolved, const char *path,
124124
if (!is_dir_sep(resolved->buf[resolved->len - 1]))
125125
strbuf_addch(resolved, '/');
126126
strbuf_addbuf(resolved, &next);
127-
128127
if (lstat(resolved->buf, &st)) {
128+
#ifdef __VMS
129+
if (errno == EPERM)
130+
continue;
131+
#endif
129132
/* error out unless this was the last component */
130133
if (errno != ENOENT ||
131134
(!(flags & REALPATH_MANY_MISSING) && remaining.len)) {
@@ -298,7 +301,14 @@ void strbuf_add_absolute_path(struct strbuf *sb, const char *path)
298301
struct stat cwd_stat, pwd_stat;
299302
size_t orig_len = sb->len;
300303
char *cwd = xgetcwd();
301-
char *pwd = getenv("PWD");
304+
char *pwd = NULL;
305+
#ifdef __VMS
306+
pwd = get_cwd();
307+
if (!pwd)
308+
die("Failed to get current working directory");
309+
#else
310+
pwd = getenv("PWD");
311+
#endif
302312
if (pwd && strcmp(pwd, cwd) &&
303313
!stat(cwd, &cwd_stat) &&
304314
(cwd_stat.st_dev || cwd_stat.st_ino) &&
@@ -311,6 +321,9 @@ void strbuf_add_absolute_path(struct strbuf *sb, const char *path)
311321
if (sb->len > orig_len && !is_dir_sep(sb->buf[sb->len - 1]))
312322
strbuf_addch(sb, '/');
313323
free(cwd);
324+
#ifdef __VMS
325+
free(pwd);
326+
#endif
314327
}
315328
strbuf_addstr(sb, path);
316329
}

add-interactive.c

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -691,11 +691,17 @@ static int run_update(struct add_i_state *s, const struct pathspec *ps,
691691

692692
opts->prompt = N_("Update");
693693
count = list_and_choose(s, files, opts);
694+
#ifdef __VMS
695+
if (count == 0 || count == SIZE_MAX) {
696+
putchar('\n');
697+
return 0;
698+
}
699+
#else
694700
if (count <= 0) {
695701
putchar('\n');
696702
return 0;
697703
}
698-
704+
#endif
699705
fd = repo_hold_locked_index(s->r, &index_lock, LOCK_REPORT_ON_ERROR);
700706
if (fd < 0) {
701707
putchar('\n');
@@ -778,9 +784,13 @@ static int run_revert(struct add_i_state *s, const struct pathspec *ps,
778784

779785
opts->prompt = N_("Revert");
780786
count = list_and_choose(s, files, opts);
787+
#ifdef __VMS
788+
if (count == 0 || count == SIZE_MAX)
789+
goto finish_revert;
790+
#else
781791
if (count <= 0)
782792
goto finish_revert;
783-
793+
#endif
784794
fd = repo_hold_locked_index(s->r, &index_lock, LOCK_REPORT_ON_ERROR);
785795
if (fd < 0) {
786796
res = -1;
@@ -889,9 +899,13 @@ static int run_add_untracked(struct add_i_state *s, const struct pathspec *ps,
889899
d->only_names = 1;
890900
count = list_and_choose(s, files, opts);
891901
d->only_names = 0;
902+
#ifdef __VMS
903+
if (count == 0 || count == SIZE_MAX)
904+
goto finish_add_untracked;
905+
#else
892906
if (count <= 0)
893907
goto finish_add_untracked;
894-
908+
#endif
895909
fd = repo_hold_locked_index(s->r, &index_lock, LOCK_REPORT_ON_ERROR);
896910
if (fd < 0) {
897911
res = -1;

async_proc_wrapper.c

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
#include <stdio.h>
2+
#include <stdlib.h>
3+
#include <string.h>
4+
#include "vms/vms_wrapper.h"
5+
#include "async_procs.h"
6+
7+
typedef int (*async_proc_func)(int proc_in, int proc_out, void *data);
8+
extern int process_is_async;
9+
10+
/*
11+
** Helper function to get the appropriate function pointer.
12+
*/
13+
async_proc_func get_async_proc_func(const char *func_name)
14+
{
15+
if (strcmp(func_name, "filter_buffer_or_fd") == 0)
16+
return filter_buffer_or_fd;
17+
else if (strcmp(func_name, "copy_to_sideband") == 0)
18+
return copy_to_sideband;
19+
else if (strcmp(func_name, "sideband_demux") == 0)
20+
return sideband_demux;
21+
else if (strcmp(func_name, "sideband_demux_fetch") == 0)
22+
return sideband_demux_fetch;
23+
else return NULL;
24+
}
25+
26+
int common_exit(const char *file, int line, int code) { return 0; }
27+
28+
int main(int argc, char *argv[])
29+
{
30+
if (argc < 6) {
31+
fprintf(stderr, "Usage: %s <func_name> <proc_in> <proc_out> <data>\n", argv[0]);
32+
return 1;
33+
}
34+
35+
const char *func_name = argv[1];
36+
int proc_in_0 = atoi(argv[2]);
37+
int proc_in_1 = atoi(argv[3]);
38+
int proc_out_0 = atoi(argv[4]);
39+
int proc_out_1 = atoi(argv[5]);
40+
void *data = NULL;
41+
if (argc == 7)
42+
data = (void*)argv[6];
43+
44+
if (proc_in_1 != -1) close(proc_in_1);
45+
if (proc_out_0 != -1) close(proc_out_0);
46+
git_atexit_clear();
47+
process_is_async = 1;
48+
49+
async_proc_func proc = get_async_proc_func(func_name);
50+
if (!proc) {
51+
fprintf(stderr, "Invalid function name: %s\n", func_name);
52+
return 1;
53+
}
54+
int result = proc(proc_in_0, proc_out_1, data);
55+
exit(!!result);
56+
}

async_procs.h

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#ifndef ASYNC_PROCS_H
2+
#define ASYNC_PROCS_H
3+
4+
void git_atexit_clear(void);
5+
6+
int filter_buffer_or_fd (int proc_in, int proc_out, void *data);
7+
int copy_to_sideband (int proc_in, int proc_out, void *data);
8+
int sideband_demux (int proc_in, int proc_out, void *data);
9+
int sideband_demux_fetch(int proc_in, int proc_out, void *data);
10+
11+
#endif /* ASYNC_PROCS_H */

attr.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,8 +199,13 @@ static int attr_name_valid(const char *name, size_t namelen)
199199
* Attribute name cannot begin with '-' and must consist of
200200
* characters from [-A-Za-z0-9_.].
201201
*/
202+
#ifdef __VMS
203+
if (namelen == 0 || namelen == SIZE_MAX || *name == '-')
204+
return 0;
205+
#else
202206
if (namelen <= 0 || *name == '-')
203207
return 0;
208+
#endif
204209
while (namelen--) {
205210
char ch = *name++;
206211
if (! (ch == '-' || ch == '.' || ch == '_' ||

bisect.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -452,7 +452,9 @@ static int register_ref(const char *refname, const struct object_id *oid,
452452
struct strbuf good_prefix = STRBUF_INIT;
453453
strbuf_addstr(&good_prefix, term_good);
454454
strbuf_addstr(&good_prefix, "-");
455-
455+
#ifdef __VMS
456+
remove_last_char_if_dot((char *)refname);
457+
#endif
456458
if (!strcmp(refname, term_bad)) {
457459
current_bad_oid = xmalloc(sizeof(*current_bad_oid));
458460
oidcpy(current_bad_oid, oid);

builtin/am.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2390,7 +2390,11 @@ int cmd_am(int argc, const char **argv, const char *prefix)
23902390
OPT_RERERE_AUTOUPDATE(&state.allow_rerere_autoupdate),
23912391
{ OPTION_STRING, 'S', "gpg-sign", &state.sign_commit, N_("key-id"),
23922392
N_("GPG-sign commits"),
2393+
#ifdef __VMS
2394+
PARSE_OPT_OPTARG, NULL, (intptr_t)(const void *) "" },
2395+
#else
23932396
PARSE_OPT_OPTARG, NULL, (intptr_t) "" },
2397+
#endif
23942398
OPT_CALLBACK_F(0, "empty", &state.empty_type, "(stop|drop|keep)",
23952399
N_("how to handle empty patches"),
23962400
PARSE_OPT_NONEG, am_option_parse_empty),

builtin/clone.c

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,11 @@ static struct option builtin_clone_options[] = {
125125
N_("setup as shared repository")),
126126
{ OPTION_CALLBACK, 0, "recurse-submodules", &option_recurse_submodules,
127127
N_("pathspec"), N_("initialize submodules in the clone"),
128+
#ifdef __VMS
129+
PARSE_OPT_OPTARG, recurse_submodules_cb, (intptr_t)(const void *)"." },
130+
#else
128131
PARSE_OPT_OPTARG, recurse_submodules_cb, (intptr_t)"." },
132+
#endif
129133
OPT_ALIAS(0, "recursive", "recurse-submodules"),
130134
OPT_INTEGER('j', "jobs", &max_jobs,
131135
N_("number of submodules cloned in parallel")),
@@ -1002,6 +1006,18 @@ int cmd_clone(int argc, const char **argv, const char *prefix)
10021006
dir = git_url_basename(repo_name, is_bundle, option_bare);
10031007
strip_dir_trailing_slashes(dir);
10041008

1009+
#ifdef __VMS
1010+
struct strbuf target_path = STRBUF_INIT;
1011+
char tmp_dir[MAXPATHLEN];
1012+
snprintf(tmp_dir, sizeof(tmp_dir), "%s", dir);
1013+
if (get_logical_name(tmp_dir) != NULL) {
1014+
strbuf_addstr(&target_path, "./");
1015+
strbuf_addstr(&target_path, dir);
1016+
1017+
free(dir);
1018+
dir = xstrdup(target_path.buf);
1019+
}
1020+
#endif
10051021
dest_exists = path_exists(dir);
10061022
if (dest_exists && !is_empty_dir(dir))
10071023
die(_("destination path '%s' already exists and is not "
@@ -1458,6 +1474,9 @@ int cmd_clone(int argc, const char **argv, const char *prefix)
14581474
free_refs(remote_head_points_at);
14591475
free(unborn_head);
14601476
free(dir);
1477+
#ifdef __VMS
1478+
strbuf_release(&target_path);
1479+
#endif
14611480
free(path);
14621481
free(repo_to_free);
14631482
junk_mode = JUNK_LEAVE_ALL;

0 commit comments

Comments
 (0)