CARVIEW |
Select Language
HTTP/2 302
server: nginx
date: Sun, 10 Aug 2025 13:26:53 GMT
content-type: text/plain; charset=utf-8
content-length: 0
x-archive-redirect-reason: found capture at 20250426160552
location: https://web.archive.org/web/20250426160552/https://github.com/git/git/tree/master/alias.c
server-timing: captures_list;dur=0.776641, exclusion.robots;dur=0.032917, exclusion.robots.policy;dur=0.017643, esindex;dur=0.016965, cdx.remote;dur=2078.676019, LoadShardBlock;dur=516.451854, PetaboxLoader3.datanode;dur=197.786538, PetaboxLoader3.resolve;dur=235.060437
x-app-server: wwwb-app220
x-ts: 302
x-tr: 2628
server-timing: TR;dur=0,Tw;dur=0,Tc;dur=0
set-cookie: wb-p-SERVER=wwwb-app220; path=/
x-location: All
x-rl: 0
x-na: 0
x-page-cache: MISS
server-timing: MISS
x-nid: DigitalOcean
referrer-policy: no-referrer-when-downgrade
permissions-policy: interest-cohort=()
HTTP/2 301
server: nginx
date: Sun, 10 Aug 2025 13:26:54 GMT
content-type: text/html; charset=utf-8
content-length: 0
x-archive-orig-date: Sat, 26 Apr 2025 16:05:52 GMT
x-archive-orig-content-length: 0
x-archive-orig-vary: X-PJAX, X-PJAX-Container, Turbo-Visit, Turbo-Frame,Accept-Encoding, Accept, X-Requested-With
location: https://web.archive.org/web/20250426160552/https://github.com/git/git/blob/master/alias.c
x-archive-orig-cache-control: no-cache
x-archive-orig-strict-transport-security: max-age=31536000; includeSubdomains; preload
x-archive-orig-x-frame-options: deny
x-archive-orig-x-content-type-options: nosniff
x-archive-orig-x-xss-protection: 0
x-archive-orig-referrer-policy: no-referrer-when-downgrade
x-archive-orig-content-security-policy: default-src 'none'; base-uri 'self'; child-src github.githubassets.com github.com/assets-cdn/worker/ github.com/assets/ gist.github.com/assets-cdn/worker/; connect-src 'self' uploads.github.com www.githubstatus.com collector.github.com raw.githubusercontent.com api.github.com github-cloud.s3.amazonaws.com github-production-repository-file-5c1aeb.s3.amazonaws.com github-production-upload-manifest-file-7fdce7.s3.amazonaws.com github-production-user-asset-6210df.s3.amazonaws.com *.rel.tunnels.api.visualstudio.com wss://*.rel.tunnels.api.visualstudio.com objects-origin.githubusercontent.com copilot-proxy.githubusercontent.com proxy.individual.githubcopilot.com proxy.business.githubcopilot.com proxy.enterprise.githubcopilot.com *.actions.githubusercontent.com wss://*.actions.githubusercontent.com productionresultssa0.blob.core.windows.net/ productionresultssa1.blob.core.windows.net/ productionresultssa2.blob.core.windows.net/ productionresultssa3.blob.core.windows.net/ productionresultssa4.blob.core.windows.net/ productionresultssa5.blob.core.windows.net/ productionresultssa6.blob.core.windows.net/ productionresultssa7.blob.core.windows.net/ productionresultssa8.blob.core.windows.net/ productionresultssa9.blob.core.windows.net/ productionresultssa10.blob.core.windows.net/ productionresultssa11.blob.core.windows.net/ productionresultssa12.blob.core.windows.net/ productionresultssa13.blob.core.windows.net/ productionresultssa14.blob.core.windows.net/ productionresultssa15.blob.core.windows.net/ productionresultssa16.blob.core.windows.net/ productionresultssa17.blob.core.windows.net/ productionresultssa18.blob.core.windows.net/ productionresultssa19.blob.core.windows.net/ github-production-repository-image-32fea6.s3.amazonaws.com github-production-release-asset-2e65be.s3.amazonaws.com insights.github.com wss://alive.github.com api.githubcopilot.com api.individual.githubcopilot.com api.business.githubcopilot.com api.enterprise.githubcopilot.com; font-src github.githubassets.com; form-action 'self' github.com gist.github.com copilot-workspace.githubnext.com objects-origin.githubusercontent.com; frame-ancestors 'none'; frame-src viewscreen.githubusercontent.com notebooks.githubusercontent.com; img-src 'self' data: blob: github.githubassets.com media.githubusercontent.com camo.githubusercontent.com identicons.github.com avatars.githubusercontent.com private-avatars.githubusercontent.com github-cloud.s3.amazonaws.com objects.githubusercontent.com release-assets.githubusercontent.com secured-user-images.githubusercontent.com/ user-images.githubusercontent.com/ private-user-images.githubusercontent.com opengraph.githubassets.com copilotprodattachments.blob.core.windows.net/github-production-copilot-attachments/ github-production-user-asset-6210df.s3.amazonaws.com customer-stories-feed.github.com spotlights-feed.github.com objects-origin.githubusercontent.com *.githubusercontent.com; manifest-src 'self'; media-src github.com user-images.githubusercontent.com/ secured-user-images.githubusercontent.com/ private-user-images.githubusercontent.com github-production-user-asset-6210df.s3.amazonaws.com gist.github.com; script-src github.githubassets.com; style-src 'unsafe-inline' github.githubassets.com; upgrade-insecure-requests; worker-src github.githubassets.com github.com/assets-cdn/worker/ github.com/assets/ gist.github.com/assets-cdn/worker/
x-archive-orig-server: github.com
x-archive-orig-set-cookie: _gh_sess=BVkCmdHo9dtQuyur6V0VJJsrZKgqBGPuv7Fmi3gAj027ZzxL7mDLHEGvMAPxWyujkKYj3R4D3rvjymsGFQWpk4IpEN0IsXZpo8eGodrOWL4%2B7KbVZ2%2FaCUwCX9H8n6yQwJItL7JQDWwV4eKMnda%2BKqvNhnkcIGsiZ4hbQqjZsaTlUQgnvBxLCrNlXATvePlTS9XYVenB4mGClvKmiBGwvlf3B02i1GDEOFJxr%2B%2F6wcKmBA2wf1okUMwVQnPnZ6fgVlLptszhEuOivsCPA3K0RQ%3D%3D--li%2FQkEyTmN1iWtVV--SSksLg1PTJUbsTGHqRjzmA%3D%3D; Path=/; HttpOnly; Secure; SameSite=Lax
x-archive-orig-set-cookie: _octo=GH1.1.211028029.1745683552; Path=/; Domain=github.com; Expires=Sun, 26 Apr 2026 16:05:52 GMT; Secure; SameSite=Lax
x-archive-orig-set-cookie: logged_in=no; Path=/; Domain=github.com; Expires=Sun, 26 Apr 2026 16:05:52 GMT; HttpOnly; Secure; SameSite=Lax
x-archive-orig-x-github-request-id: DF30:1EBB2D:2303F6:24B137:680D0460
x-archive-orig-connection: close
cache-control: max-age=1800
memento-datetime: Sat, 26 Apr 2025 16:05:52 GMT
link: ; rel="original", ; rel="timemap"; type="application/link-format", ; rel="timegate", ; rel="first memento"; datetime="Sat, 26 Apr 2025 16:05:52 GMT", ; rel="memento"; datetime="Sat, 26 Apr 2025 16:05:52 GMT", ; rel="last memento"; datetime="Sat, 26 Apr 2025 16:05:52 GMT"
content-security-policy: default-src 'self' 'unsafe-eval' 'unsafe-inline' data: blob: archive.org web.archive.org web-static.archive.org wayback-api.archive.org athena.archive.org analytics.archive.org pragma.archivelab.org wwwb-events.archive.org
x-archive-src: SPNOUTLINKS-20250426160417-crawl919/SPNOUTLINKS-20250426160424-00044.warc.gz
server-timing: captures_list;dur=0.540107, exclusion.robots;dur=0.020912, exclusion.robots.policy;dur=0.010068, esindex;dur=0.010148, cdx.remote;dur=109.552106, LoadShardBlock;dur=251.433959, PetaboxLoader3.datanode;dur=135.811564, PetaboxLoader3.resolve;dur=279.250525, load_resource;dur=192.084122
x-app-server: wwwb-app220
x-ts: 301
x-tr: 578
server-timing: TR;dur=0,Tw;dur=0,Tc;dur=0
x-location: All
x-rl: 0
x-na: 0
x-page-cache: MISS
server-timing: MISS
x-nid: DigitalOcean
referrer-policy: no-referrer-when-downgrade
permissions-policy: interest-cohort=()
HTTP/2 302
server: nginx
date: Sun, 10 Aug 2025 13:26:55 GMT
content-type: text/plain; charset=utf-8
content-length: 0
x-archive-redirect-reason: found capture at 20250226164732
location: https://web.archive.org/web/20250226164732/https://github.com/git/git/blob/master/alias.c
server-timing: captures_list;dur=0.612702, exclusion.robots;dur=0.028674, exclusion.robots.policy;dur=0.011766, esindex;dur=0.013767, cdx.remote;dur=116.909571, LoadShardBlock;dur=138.056552, PetaboxLoader3.datanode;dur=52.399356, PetaboxLoader3.resolve;dur=40.635621
x-app-server: wwwb-app220
x-ts: 302
x-tr: 283
server-timing: TR;dur=0,Tw;dur=0,Tc;dur=0
x-location: All
x-rl: 0
x-na: 0
x-page-cache: MISS
server-timing: MISS
x-nid: DigitalOcean
referrer-policy: no-referrer-when-downgrade
permissions-policy: interest-cohort=()
HTTP/2 200
server: nginx
date: Sun, 10 Aug 2025 13:26:56 GMT
content-type: text/html; charset=utf-8
x-archive-orig-server: GitHub.com
x-archive-orig-date: Wed, 26 Feb 2025 16:47:32 GMT
x-archive-orig-vary: X-PJAX, X-PJAX-Container, Turbo-Visit, Turbo-Frame, Accept-Encoding, Accept, X-Requested-With
x-archive-orig-etag: W/"4fad4ef1e95ba376db7f7639247eb8c1"
x-archive-orig-cache-control: max-age=0, private, must-revalidate
x-archive-orig-strict-transport-security: max-age=31536000; includeSubdomains; preload
x-archive-orig-x-frame-options: deny
x-archive-orig-x-content-type-options: nosniff
x-archive-orig-x-xss-protection: 0
x-archive-orig-referrer-policy: no-referrer-when-downgrade
x-archive-orig-content-security-policy: default-src 'none'; base-uri 'self'; child-src github.com/assets-cdn/worker/ github.com/webpack/ github.com/assets/ gist.github.com/assets-cdn/worker/; connect-src 'self' uploads.github.com www.githubstatus.com collector.github.com raw.githubusercontent.com api.github.com github-cloud.s3.amazonaws.com github-production-repository-file-5c1aeb.s3.amazonaws.com github-production-upload-manifest-file-7fdce7.s3.amazonaws.com github-production-user-asset-6210df.s3.amazonaws.com *.rel.tunnels.api.visualstudio.com wss://*.rel.tunnels.api.visualstudio.com objects-origin.githubusercontent.com copilot-proxy.githubusercontent.com proxy.individual.githubcopilot.com proxy.business.githubcopilot.com proxy.enterprise.githubcopilot.com *.actions.githubusercontent.com wss://*.actions.githubusercontent.com productionresultssa0.blob.core.windows.net/ productionresultssa1.blob.core.windows.net/ productionresultssa2.blob.core.windows.net/ productionresultssa3.blob.core.windows.net/ productionresultssa4.blob.core.windows.net/ productionresultssa5.blob.core.windows.net/ productionresultssa6.blob.core.windows.net/ productionresultssa7.blob.core.windows.net/ productionresultssa8.blob.core.windows.net/ productionresultssa9.blob.core.windows.net/ productionresultssa10.blob.core.windows.net/ productionresultssa11.blob.core.windows.net/ productionresultssa12.blob.core.windows.net/ productionresultssa13.blob.core.windows.net/ productionresultssa14.blob.core.windows.net/ productionresultssa15.blob.core.windows.net/ productionresultssa16.blob.core.windows.net/ productionresultssa17.blob.core.windows.net/ productionresultssa18.blob.core.windows.net/ productionresultssa19.blob.core.windows.net/ github-production-repository-image-32fea6.s3.amazonaws.com github-production-release-asset-2e65be.s3.amazonaws.com insights.github.com wss://alive.github.com api.githubcopilot.com api.individual.githubcopilot.com api.business.githubcopilot.com api.enterprise.githubcopilot.com; font-src github.githubassets.com; form-action 'self' github.com gist.github.com copilot-workspace.githubnext.com objects-origin.githubusercontent.com; frame-ancestors 'none'; frame-src viewscreen.githubusercontent.com notebooks.githubusercontent.com; img-src 'self' data: blob: github.githubassets.com media.githubusercontent.com camo.githubusercontent.com identicons.github.com avatars.githubusercontent.com private-avatars.githubusercontent.com github-cloud.s3.amazonaws.com objects.githubusercontent.com secured-user-images.githubusercontent.com/ user-images.githubusercontent.com/ private-user-images.githubusercontent.com opengraph.githubassets.com github-production-user-asset-6210df.s3.amazonaws.com customer-stories-feed.github.com spotlights-feed.github.com objects-origin.githubusercontent.com *.githubusercontent.com; manifest-src 'self'; media-src github.com user-images.githubusercontent.com/ secured-user-images.githubusercontent.com/ private-user-images.githubusercontent.com github-production-user-asset-6210df.s3.amazonaws.com gist.github.com; script-src github.githubassets.com; style-src 'unsafe-inline' github.githubassets.com; upgrade-insecure-requests; worker-src github.com/assets-cdn/worker/ github.com/webpack/ github.com/assets/ gist.github.com/assets-cdn/worker/
x-archive-orig-accept-ranges: bytes
x-archive-orig-set-cookie: _gh_sess=ig5K6neKUhyPP8BrdPjSRr8AIUxCaGpf5USXrUmEbnt7CDD%2FqtrRIBiK%2Fc9jUznvEK90%2BV9AvviE1%2FfSnc3MPTk4618Qo%2BBMnZ9Z5UtHjcl3GOgZIvYuzkFO%2BXS6n8%2BWZWYXuqi19TSiLPAwws%2BKNPHQWyZbKq8AbKN8dA5m%2FSCRD275ShqVtsnAcm3Wr2At%2FYAjEqhQX175dfoP8OIvi9CV2s%2Fxz4DIK3CZE5pSGrG5FK4AqzxZH9KrKbBBVjJLCd6rjpPbtV0bA%2BykQr9UkA%3D%3D--qmTxG9RSrK5RO2w7--%2Bd8eGv%2FrvRJnSWz22AAiJQ%3D%3D; Path=/; HttpOnly; Secure; SameSite=Lax
x-archive-orig-set-cookie: _octo=GH1.1.1269661748.1740588452; Path=/; Domain=github.com; Expires=Thu, 26 Feb 2026 16:47:32 GMT; Secure; SameSite=Lax
x-archive-orig-set-cookie: logged_in=no; Path=/; Domain=github.com; Expires=Thu, 26 Feb 2026 16:47:32 GMT; HttpOnly; Secure; SameSite=Lax
x-archive-orig-x-github-request-id: E43E:1CB2F0:468305:48F890:67BF45A3
x-archive-orig-connection: close
x-archive-orig-transfer-encoding: chunked
x-archive-guessed-content-type: text/html
x-archive-guessed-charset: utf-8
x-archive-orig-content-encoding: gzip
memento-datetime: Wed, 26 Feb 2025 16:47:32 GMT
link: ; rel="original", ; rel="timemap"; type="application/link-format", ; rel="timegate", ; rel="first memento"; datetime="Tue, 25 Jul 2017 18:09:12 GMT", ; rel="prev memento"; datetime="Sat, 07 Dec 2024 16:06:46 GMT", ; rel="memento"; datetime="Wed, 26 Feb 2025 16:47:32 GMT", ; rel="last memento"; datetime="Wed, 26 Feb 2025 16:47:32 GMT"
content-security-policy: default-src 'self' 'unsafe-eval' 'unsafe-inline' data: blob: archive.org web.archive.org web-static.archive.org wayback-api.archive.org athena.archive.org analytics.archive.org pragma.archivelab.org wwwb-events.archive.org
x-archive-src: FC-20250226164318-crawl924/FC-20250226164324-00069.warc.gz
server-timing: captures_list;dur=0.695432, exclusion.robots;dur=0.029039, exclusion.robots.policy;dur=0.012850, esindex;dur=0.013869, cdx.remote;dur=85.388793, LoadShardBlock;dur=820.347024, PetaboxLoader3.datanode;dur=742.743257, PetaboxLoader3.resolve;dur=373.019220, load_resource;dur=367.553473
x-app-server: wwwb-app220
x-ts: 200
x-tr: 1497
server-timing: TR;dur=0,Tw;dur=0,Tc;dur=0
x-location: All
x-rl: 0
x-na: 0
x-page-cache: MISS
server-timing: MISS
x-nid: DigitalOcean
referrer-policy: no-referrer-when-downgrade
permissions-policy: interest-cohort=()
content-encoding: gzip
git/alias.c at master · git/git · GitHub
{{ message }}
-
Notifications
You must be signed in to change notification settings - Fork 25.9k
/
Copy pathalias.c
139 lines (116 loc) · 2.79 KB
/
alias.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
#define USE_THE_REPOSITORY_VARIABLE
#include "git-compat-util.h"
#include "alias.h"
#include "config.h"
#include "gettext.h"
#include "strbuf.h"
#include "string-list.h"
struct config_alias_data {
const char *alias;
char *v;
struct string_list *list;
};
static int config_alias_cb(const char *key, const char *value,
const struct config_context *ctx UNUSED, void *d)
{
struct config_alias_data *data = d;
const char *p;
if (!skip_prefix(key, "alias.", &p))
return 0;
if (data->alias) {
if (!strcasecmp(p, data->alias)) {
FREE_AND_NULL(data->v);
return git_config_string(&data->v,
key, value);
}
} else if (data->list) {
string_list_append(data->list, p);
}
return 0;
}
char *alias_lookup(const char *alias)
{
struct config_alias_data data = { alias, NULL };
read_early_config(the_repository, config_alias_cb, &data);
return data.v;
}
void list_aliases(struct string_list *list)
{
struct config_alias_data data = { NULL, NULL, list };
read_early_config(the_repository, config_alias_cb, &data);
}
void quote_cmdline(struct strbuf *buf, const char **argv)
{
for (const char **argp = argv; *argp; argp++) {
if (argp != argv)
strbuf_addch(buf, ' ');
strbuf_addch(buf, '"');
for (const char *p = *argp; *p; p++) {
const char c = *p;
if (c == '"' || c =='\\')
strbuf_addch(buf, '\\');
strbuf_addch(buf, c);
}
strbuf_addch(buf, '"');
}
}
#define SPLIT_CMDLINE_BAD_ENDING 1
#define SPLIT_CMDLINE_UNCLOSED_QUOTE 2
#define SPLIT_CMDLINE_ARGC_OVERFLOW 3
static const char *split_cmdline_errors[] = {
N_("cmdline ends with \\"),
N_("unclosed quote"),
N_("too many arguments"),
};
int split_cmdline(char *cmdline, const char ***argv)
{
size_t src, dst, count = 0, size = 16;
char quoted = 0;
ALLOC_ARRAY(*argv, size);
/* split alias_string */
(*argv)[count++] = cmdline;
for (src = dst = 0; cmdline[src];) {
char c = cmdline[src];
if (!quoted && isspace(c)) {
cmdline[dst++] = 0;
while (cmdline[++src]
&& isspace(cmdline[src]))
; /* skip */
ALLOC_GROW(*argv, count + 1, size);
(*argv)[count++] = cmdline + dst;
} else if (!quoted && (c == '\'' || c == '"')) {
quoted = c;
src++;
} else if (c == quoted) {
quoted = 0;
src++;
} else {
if (c == '\\' && quoted != '\'') {
src++;
c = cmdline[src];
if (!c) {
FREE_AND_NULL(*argv);
return -SPLIT_CMDLINE_BAD_ENDING;
}
}
cmdline[dst++] = c;
src++;
}
}
cmdline[dst] = 0;
if (quoted) {
FREE_AND_NULL(*argv);
return -SPLIT_CMDLINE_UNCLOSED_QUOTE;
}
if (count >= INT_MAX) {
FREE_AND_NULL(*argv);
return -SPLIT_CMDLINE_ARGC_OVERFLOW;
}
ALLOC_GROW(*argv, count + 1, size);
(*argv)[count] = NULL;
return count;
}
const char *split_cmdline_strerror(int split_cmdline_errno)
{
return split_cmdline_errors[-split_cmdline_errno - 1];
}
You can’t perform that action at this time.