Skip to content

Commit b0e709e

Browse files
committed
Merge branch 'busybox-w32'
Signed-off-by: Johannes Schindelin <[email protected]>
2 parents 26068d8 + 1ec17cd commit b0e709e

File tree

83 files changed

+1683
-485
lines changed

Some content is hidden

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

83 files changed

+1683
-485
lines changed

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
*.perl eol=lf diff=perl
55
*.pl eof=lf diff=perl
66
*.pm eol=lf diff=perl
7+
*.png binary
78
*.py eol=lf diff=python
89
*.bat eol=crlf
910
/Documentation/**/*.txt eol=lf

Documentation/Makefile

Lines changed: 44 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -298,9 +298,9 @@ docdep_prereqs = \
298298
cmd-list.made $(cmds_txt)
299299

300300
doc.dep : $(docdep_prereqs) $(wildcard *.txt) $(wildcard config/*.txt) build-docdep.perl
301-
$(QUIET_GEN)$(RM) $@+ $@ && \
302-
$(PERL_PATH) ./build-docdep.perl >$@+ $(QUIET_STDERR) && \
303-
mv $@+ $@
301+
$(QUIET_GEN)$(RM) $@.new $@ && \
302+
$(PERL_PATH) ./build-docdep.perl >$@.new $(QUIET_STDERR) && \
303+
mv $@.new $@
304304

305305
-include doc.dep
306306

@@ -345,8 +345,8 @@ GIT-ASCIIDOCFLAGS: FORCE
345345
fi
346346

347347
clean:
348-
$(RM) *.xml *.xml+ *.html *.html+ *.1 *.5 *.7
349-
$(RM) *.texi *.texi+ *.texi++ git.info gitman.info
348+
$(RM) *.xml *.xml.new *.html *.html.new *.1 *.5 *.7
349+
$(RM) *.texi *.texi.new *.texi.new.new git.info gitman.info
350350
$(RM) *.pdf
351351
$(RM) howto-index.txt howto/*.html doc.dep
352352
$(RM) technical/*.html technical/api-index.txt
@@ -356,14 +356,14 @@ clean:
356356
$(RM) GIT-ASCIIDOCFLAGS
357357

358358
$(MAN_HTML): %.html : %.txt asciidoc.conf asciidoctor-extensions.rb GIT-ASCIIDOCFLAGS
359-
$(QUIET_ASCIIDOC)$(RM) $@+ $@ && \
360-
$(TXT_TO_HTML) -d manpage -o $@+ $< && \
361-
mv $@+ $@
359+
$(QUIET_ASCIIDOC)$(RM) $@.new $@ && \
360+
$(TXT_TO_HTML) -d manpage -o $@.new $< && \
361+
mv $@.new $@
362362

363363
$(OBSOLETE_HTML): %.html : %.txto asciidoc.conf asciidoctor-extensions.rb GIT-ASCIIDOCFLAGS
364-
$(QUIET_ASCIIDOC)$(RM) $@+ $@ && \
365-
$(TXT_TO_HTML) -o $@+ $< && \
366-
mv $@+ $@
364+
$(QUIET_ASCIIDOC)$(RM) $@.new $@ && \
365+
$(TXT_TO_HTML) -o $@.new $< && \
366+
mv $@.new $@
367367

368368
manpage-base-url.xsl: manpage-base-url.xsl.in
369369
$(QUIET_GEN)sed "s|@@MAN_BASE_URL@@|$(MAN_BASE_URL)|" $< > $@
@@ -373,14 +373,14 @@ manpage-base-url.xsl: manpage-base-url.xsl.in
373373
$(XMLTO) -m $(MANPAGE_XSL) $(XMLTO_EXTRA) man $<
374374

375375
%.xml : %.txt asciidoc.conf asciidoctor-extensions.rb GIT-ASCIIDOCFLAGS
376-
$(QUIET_ASCIIDOC)$(RM) $@+ $@ && \
377-
$(TXT_TO_XML) -d manpage -o $@+ $< && \
378-
mv $@+ $@
376+
$(QUIET_ASCIIDOC)$(RM) $@.new $@ && \
377+
$(TXT_TO_XML) -d manpage -o $@.new $< && \
378+
mv $@.new $@
379379

380380
user-manual.xml: user-manual.txt user-manual.conf asciidoctor-extensions.rb GIT-ASCIIDOCFLAGS
381-
$(QUIET_ASCIIDOC)$(RM) $@+ $@ && \
382-
$(TXT_TO_XML) -d book -o $@+ $< && \
383-
mv $@+ $@
381+
$(QUIET_ASCIIDOC)$(RM) $@.new $@ && \
382+
$(TXT_TO_XML) -d book -o $@.new $< && \
383+
mv $@.new $@
384384

385385
technical/api-index.txt: technical/api-index-skel.txt \
386386
technical/api-index.sh $(patsubst %,%.txt,$(API_DOCS))
@@ -398,46 +398,46 @@ XSLT = docbook.xsl
398398
XSLTOPTS = --xinclude --stringparam html.stylesheet docbook-xsl.css
399399

400400
user-manual.html: user-manual.xml $(XSLT)
401-
$(QUIET_XSLTPROC)$(RM) $@+ $@ && \
402-
xsltproc $(XSLTOPTS) -o $@+ $(XSLT) $< && \
403-
mv $@+ $@
401+
$(QUIET_XSLTPROC)$(RM) $@.new $@ && \
402+
xsltproc $(XSLTOPTS) -o $@.new $(XSLT) $< && \
403+
mv $@.new $@
404404

405405
git.info: user-manual.texi
406406
$(QUIET_MAKEINFO)$(MAKEINFO) --no-split -o $@ user-manual.texi
407407

408408
user-manual.texi: user-manual.xml
409-
$(QUIET_DB2TEXI)$(RM) $@+ $@ && \
410-
$(DOCBOOK2X_TEXI) user-manual.xml --encoding=UTF-8 --to-stdout >$@++ && \
411-
$(PERL_PATH) fix-texi.perl <$@++ >$@+ && \
412-
rm $@++ && \
413-
mv $@+ $@
409+
$(QUIET_DB2TEXI)$(RM) $@.new $@ && \
410+
$(DOCBOOK2X_TEXI) user-manual.xml --encoding=UTF-8 --to-stdout >$@.new.new && \
411+
$(PERL_PATH) fix-texi.perl <$@.new.new >$@.new && \
412+
rm $@.new.new && \
413+
mv $@.new $@
414414

415415
user-manual.pdf: user-manual.xml
416-
$(QUIET_DBLATEX)$(RM) $@+ $@ && \
417-
$(DBLATEX) -o $@+ $(DBLATEX_COMMON) $< && \
418-
mv $@+ $@
416+
$(QUIET_DBLATEX)$(RM) $@.new $@ && \
417+
$(DBLATEX) -o $@.new $(DBLATEX_COMMON) $< && \
418+
mv $@.new $@
419419

420420
gitman.texi: $(MAN_XML) cat-texi.perl texi.xsl
421-
$(QUIET_DB2TEXI)$(RM) $@+ $@ && \
422-
($(foreach xml,$(sort $(MAN_XML)),xsltproc -o $(xml)+ texi.xsl $(xml) && \
423-
$(DOCBOOK2X_TEXI) --encoding=UTF-8 --to-stdout $(xml)+ && \
424-
rm $(xml)+ &&) true) > $@++ && \
425-
$(PERL_PATH) cat-texi.perl $@ <$@++ >$@+ && \
426-
rm $@++ && \
427-
mv $@+ $@
421+
$(QUIET_DB2TEXI)$(RM) $@.new $@ && \
422+
($(foreach xml,$(sort $(MAN_XML)),xsltproc -o $(xml).new texi.xsl $(xml) && \
423+
$(DOCBOOK2X_TEXI) --encoding=UTF-8 --to-stdout $(xml).new && \
424+
rm $(xml).new &&) true) > $@.new.new && \
425+
$(PERL_PATH) cat-texi.perl $@ <$@.new.new >$@.new && \
426+
rm $@.new.new && \
427+
mv $@.new $@
428428

429429
gitman.info: gitman.texi
430430
$(QUIET_MAKEINFO)$(MAKEINFO) --no-split --no-validate $*.texi
431431

432432
$(patsubst %.txt,%.texi,$(MAN_TXT)): %.texi : %.xml
433-
$(QUIET_DB2TEXI)$(RM) $@+ $@ && \
434-
$(DOCBOOK2X_TEXI) --to-stdout $*.xml >$@+ && \
435-
mv $@+ $@
433+
$(QUIET_DB2TEXI)$(RM) $@.new $@ && \
434+
$(DOCBOOK2X_TEXI) --to-stdout $*.xml >$@.new && \
435+
mv $@.new $@
436436

437437
howto-index.txt: howto-index.sh $(wildcard howto/*.txt)
438-
$(QUIET_GEN)$(RM) $@+ $@ && \
439-
'$(SHELL_PATH_SQ)' ./howto-index.sh $(sort $(wildcard howto/*.txt)) >$@+ && \
440-
mv $@+ $@
438+
$(QUIET_GEN)$(RM) $@.new $@ && \
439+
'$(SHELL_PATH_SQ)' ./howto-index.sh $(sort $(wildcard howto/*.txt)) >$@.new && \
440+
mv $@.new $@
441441

442442
$(patsubst %,%.html,$(ARTICLES)) : %.html : %.txt
443443
$(QUIET_ASCIIDOC)$(TXT_TO_HTML) $*.txt
@@ -446,10 +446,10 @@ WEBDOC_DEST = /pub/software/scm/git/docs
446446

447447
howto/%.html: ASCIIDOC_EXTRA += -a git-relative-html-prefix=../
448448
$(patsubst %.txt,%.html,$(wildcard howto/*.txt)): %.html : %.txt GIT-ASCIIDOCFLAGS
449-
$(QUIET_ASCIIDOC)$(RM) $@+ $@ && \
449+
$(QUIET_ASCIIDOC)$(RM) $@.new $@ && \
450450
sed -e '1,/^$$/d' $< | \
451-
$(TXT_TO_HTML) - >$@+ && \
452-
mv $@+ $@
451+
$(TXT_TO_HTML) - >$@.new && \
452+
mv $@.new $@
453453

454454
install-webdoc : html
455455
'$(SHELL_PATH_SQ)' ./install-webdoc.sh $(WEBDOC_DEST)

Documentation/gitattributes.txt

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -383,6 +383,36 @@ sign `$` upon checkout. Any byte sequence that begins with
383383
with `$Id$` upon check-in.
384384

385385

386+
`symlink`
387+
^^^^^^^^^
388+
389+
On Windows, symbolic links have a type: a "file symlink" must point at
390+
a file, and a "directory symlink" must point at a directory. If the
391+
type of symlink does not match its target, it doesn't work.
392+
393+
Git does not record the type of symlink in the index or in a tree. On
394+
checkout it'll guess the type, which only works if the target exists
395+
at the time the symlink is created. This may often not be the case,
396+
for example when the link points at a directory inside a submodule.
397+
398+
The `symlink` attribute allows you to explicitly set the type of symlink
399+
to `file` or `dir`, so Git doesn't have to guess. If you have a set of
400+
symlinks that point at other files, you can do:
401+
402+
------------------------
403+
*.gif symlink=file
404+
------------------------
405+
406+
To tell Git that a symlink points at a directory, use:
407+
408+
------------------------
409+
tools_folder symlink=dir
410+
------------------------
411+
412+
The `symlink` attribute is ignored on platforms other than Windows,
413+
since they don't distinguish between different types of symlinks.
414+
415+
386416
`filter`
387417
^^^^^^^^
388418

Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -706,6 +706,7 @@ X =
706706
PROGRAMS += $(patsubst %.o,git-%$X,$(PROGRAM_OBJS))
707707

708708
TEST_BUILTINS_OBJS += test-chmtime.o
709+
TEST_BUILTINS_OBJS += test-cmp.o
709710
TEST_BUILTINS_OBJS += test-config.o
710711
TEST_BUILTINS_OBJS += test-ctype.o
711712
TEST_BUILTINS_OBJS += test-date.o
@@ -721,6 +722,7 @@ TEST_BUILTINS_OBJS += test-genzeros.o
721722
TEST_BUILTINS_OBJS += test-hash.o
722723
TEST_BUILTINS_OBJS += test-hashmap.o
723724
TEST_BUILTINS_OBJS += test-hash-speed.o
725+
TEST_BUILTINS_OBJS += test-iconv.o
724726
TEST_BUILTINS_OBJS += test-index-version.o
725727
TEST_BUILTINS_OBJS += test-json-writer.o
726728
TEST_BUILTINS_OBJS += test-lazy-init-name-hash.o

apply.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4350,7 +4350,7 @@ static int try_create_file(struct apply_state *state, const char *path,
43504350
/* Although buf:size is counted string, it also is NUL
43514351
* terminated.
43524352
*/
4353-
return !!symlink(buf, path);
4353+
return !!create_symlink(state && state->repo ? state->repo->index : NULL, buf, path);
43544354

43554355
fd = open(path, O_CREAT | O_EXCL | O_WRONLY, (mode & 0100) ? 0777 : 0666);
43564356
if (fd < 0)

builtin/clean.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -595,6 +595,7 @@ static int *list_and_choose(struct menu_opts *opts, struct menu_stuff *stuff)
595595
clean_get_color(CLEAN_COLOR_RESET));
596596
}
597597

598+
fflush(stdout);
598599
if (strbuf_getline_lf(&choice, stdin) != EOF) {
599600
strbuf_trim(&choice);
600601
} else {
@@ -677,6 +678,7 @@ static int filter_by_patterns_cmd(void)
677678
clean_print_color(CLEAN_COLOR_PROMPT);
678679
printf(_("Input ignore patterns>> "));
679680
clean_print_color(CLEAN_COLOR_RESET);
681+
fflush(stdout);
680682
if (strbuf_getline_lf(&confirm, stdin) != EOF)
681683
strbuf_trim(&confirm);
682684
else
@@ -775,6 +777,7 @@ static int ask_each_cmd(void)
775777
qname = quote_path_relative(item->string, NULL, &buf);
776778
/* TRANSLATORS: Make sure to keep [y/N] as is */
777779
printf(_("Remove %s [y/N]? "), qname);
780+
fflush(stdout);
778781
if (strbuf_getline_lf(&confirm, stdin) != EOF) {
779782
strbuf_trim(&confirm);
780783
} else {

builtin/difftool.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -497,7 +497,7 @@ static int run_dir_diff(const char *extcmd, int symlinks, const char *prefix,
497497
}
498498
add_path(&wtdir, wtdir_len, dst_path);
499499
if (symlinks) {
500-
if (symlink(wtdir.buf, rdir.buf)) {
500+
if (create_symlink(lstate.istate, wtdir.buf, rdir.buf)) {
501501
ret = error_errno("could not symlink '%s' to '%s'", wtdir.buf, rdir.buf);
502502
goto finish;
503503
}

builtin/init-db.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ static void copy_templates_1(struct strbuf *path, struct strbuf *template_path,
7676
if (strbuf_readlink(&lnk, template_path->buf,
7777
st_template.st_size) < 0)
7878
die_errno(_("cannot readlink '%s'"), template_path->buf);
79-
if (symlink(lnk.buf, path->buf))
79+
if (create_symlink(NULL, lnk.buf, path->buf))
8080
die_errno(_("cannot symlink '%s' '%s'"),
8181
lnk.buf, path->buf);
8282
strbuf_release(&lnk);
@@ -280,7 +280,7 @@ static int create_default_files(const char *template_path,
280280
path = git_path_buf(&buf, "tXXXXXX");
281281
if (!close(xmkstemp(path)) &&
282282
!unlink(path) &&
283-
!symlink("testing", path) &&
283+
!create_symlink(NULL, "testing", path) &&
284284
!lstat(path, &st1) &&
285285
S_ISLNK(st1.st_mode))
286286
unlink(path); /* good */

0 commit comments

Comments
 (0)