Skip to content

Commit

Permalink
Merge branch 'busybox-w32'
Browse files Browse the repository at this point in the history
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
  • Loading branch information
dscho committed Feb 12, 2019
2 parents ff895c0 + 8b2ea99 commit 684a739
Show file tree
Hide file tree
Showing 87 changed files with 1,720 additions and 488 deletions.
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
*.perl eol=lf diff=perl
*.pl eof=lf diff=perl
*.pm eol=lf diff=perl
*.png binary
*.py eol=lf diff=python
*.bat eol=crlf
/Documentation/**/*.txt eol=lf
Expand Down
88 changes: 44 additions & 44 deletions Documentation/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -294,9 +294,9 @@ docdep_prereqs = \
cmd-list.made $(cmds_txt)

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

-include doc.dep

Expand Down Expand Up @@ -332,8 +332,8 @@ mergetools-list.made: ../git-mergetool--lib.sh $(wildcard ../mergetools/*)
date >$@

clean:
$(RM) *.xml *.xml+ *.html *.html+ *.1 *.5 *.7
$(RM) *.texi *.texi+ *.texi++ git.info gitman.info
$(RM) *.xml *.xml.new *.html *.html.new *.1 *.5 *.7
$(RM) *.texi *.texi.new *.texi.new.new git.info gitman.info
$(RM) *.pdf
$(RM) howto-index.txt howto/*.html doc.dep
$(RM) technical/*.html technical/api-index.txt
Expand All @@ -342,14 +342,14 @@ clean:
$(RM) manpage-base-url.xsl

$(MAN_HTML): %.html : %.txt asciidoc.conf
$(QUIET_ASCIIDOC)$(RM) $@+ $@ && \
$(TXT_TO_HTML) -d manpage -o $@+ $< && \
mv $@+ $@
$(QUIET_ASCIIDOC)$(RM) $@.new $@ && \
$(TXT_TO_HTML) -d manpage -o $@.new $< && \
mv $@.new $@

$(OBSOLETE_HTML): %.html : %.txto asciidoc.conf
$(QUIET_ASCIIDOC)$(RM) $@+ $@ && \
$(TXT_TO_HTML) -o $@+ $< && \
mv $@+ $@
$(QUIET_ASCIIDOC)$(RM) $@.new $@ && \
$(TXT_TO_HTML) -o $@.new $< && \
mv $@.new $@

manpage-base-url.xsl: manpage-base-url.xsl.in
$(QUIET_GEN)sed "s|@@MAN_BASE_URL@@|$(MAN_BASE_URL)|" $< > $@
Expand All @@ -359,14 +359,14 @@ manpage-base-url.xsl: manpage-base-url.xsl.in
$(XMLTO) -m $(MANPAGE_XSL) $(XMLTO_EXTRA) man $<

%.xml : %.txt asciidoc.conf
$(QUIET_ASCIIDOC)$(RM) $@+ $@ && \
$(TXT_TO_XML) -d manpage -o $@+ $< && \
mv $@+ $@
$(QUIET_ASCIIDOC)$(RM) $@.new $@ && \
$(TXT_TO_XML) -d manpage -o $@.new $< && \
mv $@.new $@

user-manual.xml: user-manual.txt user-manual.conf
$(QUIET_ASCIIDOC)$(RM) $@+ $@ && \
$(TXT_TO_XML) -d book -o $@+ $< && \
mv $@+ $@
$(QUIET_ASCIIDOC)$(RM) $@.new $@ && \
$(TXT_TO_XML) -d book -o $@.new $< && \
mv $@.new $@

technical/api-index.txt: technical/api-index-skel.txt \
technical/api-index.sh $(patsubst %,%.txt,$(API_DOCS))
Expand All @@ -383,46 +383,46 @@ XSLT = docbook.xsl
XSLTOPTS = --xinclude --stringparam html.stylesheet docbook-xsl.css

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

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

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

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

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

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

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

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

$(patsubst %,%.html,$(ARTICLES)) : %.html : %.txt
$(QUIET_ASCIIDOC)$(TXT_TO_HTML) $*.txt
Expand All @@ -431,10 +431,10 @@ WEBDOC_DEST = /pub/software/scm/git/docs

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

install-webdoc : html
'$(SHELL_PATH_SQ)' ./install-webdoc.sh $(WEBDOC_DEST)
Expand Down
4 changes: 3 additions & 1 deletion Documentation/config.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ the Git commands' behavior. The files `.git/config` and optionally
repository are used to store the configuration for that repository, and
`$HOME/.gitconfig` is used to store a per-user configuration as
fallback values for the `.git/config` file. The file `/etc/gitconfig`
can be used to store a system-wide default configuration.
can be used to store a system-wide default configuration. On Windows,
configuration can also be stored in `C:\ProgramData\Git\config`; This
file will be used also by libgit2-based software.

The configuration variables are used by both the Git plumbing
and the porcelains. The variables are divided into sections, wherein
Expand Down
8 changes: 8 additions & 0 deletions Documentation/git-config.txt
Original file line number Diff line number Diff line change
Expand Up @@ -270,8 +270,16 @@ FILES
If not set explicitly with `--file`, there are four files where
'git config' will search for configuration options:

$PROGRAMDATA/Git/config::
(Windows-only) System-wide configuration file shared with other Git
implementations. Typically `$PROGRAMDATA` points to `C:\ProgramData`.

$(prefix)/etc/gitconfig::
System-wide configuration file.
(Windows-only) This file contains only the settings which are
specific for this installation of Git for Windows and which should
not be shared with other Git implementations like JGit, libgit2.
`--system` will select this file.

$XDG_CONFIG_HOME/git/config::
Second user-specific configuration file. If $XDG_CONFIG_HOME is not set
Expand Down
3 changes: 2 additions & 1 deletion Documentation/git.txt
Original file line number Diff line number Diff line change
Expand Up @@ -567,7 +567,8 @@ for further details.

`GIT_CONFIG_NOSYSTEM`::
Whether to skip reading settings from the system-wide
`$(prefix)/etc/gitconfig` file. This environment variable can
`$(prefix)/etc/gitconfig` file (and on Windows, also from the
`%PROGRAMDATA%\Git\config` file). This environment variable can
be used along with `$HOME` and `$XDG_CONFIG_HOME` to create a
predictable environment for a picky script, or you can set it
temporarily to avoid using a buggy `/etc/gitconfig` file while
Expand Down
30 changes: 30 additions & 0 deletions Documentation/gitattributes.txt
Original file line number Diff line number Diff line change
Expand Up @@ -382,6 +382,36 @@ sign `$` upon checkout. Any byte sequence that begins with
with `$Id$` upon check-in.


`symlink`
^^^^^^^^^

On Windows, symbolic links have a type: a "file symlink" must point at
a file, and a "directory symlink" must point at a directory. If the
type of symlink does not match its target, it doesn't work.

Git does not record the type of symlink in the index or in a tree. On
checkout it'll guess the type, which only works if the target exists
at the time the symlink is created. This may often not be the case,
for example when the link points at a directory inside a submodule.

The `symlink` attribute allows you to explicitly set the type of symlink
to `file` or `dir`, so Git doesn't have to guess. If you have a set of
symlinks that point at other files, you can do:

------------------------
*.gif symlink=file
------------------------

To tell Git that a symlink points at a directory, use:

------------------------
tools_folder symlink=dir
------------------------

The `symlink` attribute is ignored on platforms other than Windows,
since they don't distinguish between different types of symlinks.


`filter`
^^^^^^^^

Expand Down
2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -727,6 +727,7 @@ X =
PROGRAMS += $(patsubst %.o,git-%$X,$(PROGRAM_OBJS))

TEST_BUILTINS_OBJS += test-chmtime.o
TEST_BUILTINS_OBJS += test-cmp.o
TEST_BUILTINS_OBJS += test-config.o
TEST_BUILTINS_OBJS += test-ctype.o
TEST_BUILTINS_OBJS += test-date.o
Expand All @@ -741,6 +742,7 @@ TEST_BUILTINS_OBJS += test-genrandom.o
TEST_BUILTINS_OBJS += test-hash.o
TEST_BUILTINS_OBJS += test-hashmap.o
TEST_BUILTINS_OBJS += test-hash-speed.o
TEST_BUILTINS_OBJS += test-iconv.o
TEST_BUILTINS_OBJS += test-index-version.o
TEST_BUILTINS_OBJS += test-json-writer.o
TEST_BUILTINS_OBJS += test-lazy-init-name-hash.o
Expand Down
2 changes: 1 addition & 1 deletion apply.c
Original file line number Diff line number Diff line change
Expand Up @@ -4346,7 +4346,7 @@ static int try_create_file(struct apply_state *state, const char *path,
/* Although buf:size is counted string, it also is NUL
* terminated.
*/
return !!symlink(buf, path);
return !!create_symlink(state && state->repo ? state->repo->index : NULL, buf, path);

fd = open(path, O_CREAT | O_EXCL | O_WRONLY, (mode & 0100) ? 0777 : 0666);
if (fd < 0)
Expand Down
3 changes: 3 additions & 0 deletions builtin/clean.c
Original file line number Diff line number Diff line change
Expand Up @@ -578,6 +578,7 @@ static int *list_and_choose(struct menu_opts *opts, struct menu_stuff *stuff)
clean_get_color(CLEAN_COLOR_RESET));
}

fflush(stdout);
if (strbuf_getline_lf(&choice, stdin) != EOF) {
strbuf_trim(&choice);
} else {
Expand Down Expand Up @@ -660,6 +661,7 @@ static int filter_by_patterns_cmd(void)
clean_print_color(CLEAN_COLOR_PROMPT);
printf(_("Input ignore patterns>> "));
clean_print_color(CLEAN_COLOR_RESET);
fflush(stdout);
if (strbuf_getline_lf(&confirm, stdin) != EOF)
strbuf_trim(&confirm);
else
Expand Down Expand Up @@ -758,6 +760,7 @@ static int ask_each_cmd(void)
qname = quote_path_relative(item->string, NULL, &buf);
/* TRANSLATORS: Make sure to keep [y/N] as is */
printf(_("Remove %s [y/N]? "), qname);
fflush(stdout);
if (strbuf_getline_lf(&confirm, stdin) != EOF) {
strbuf_trim(&confirm);
} else {
Expand Down
2 changes: 1 addition & 1 deletion builtin/difftool.c
Original file line number Diff line number Diff line change
Expand Up @@ -505,7 +505,7 @@ static int run_dir_diff(const char *extcmd, int symlinks, const char *prefix,
}
add_path(&wtdir, wtdir_len, dst_path);
if (symlinks) {
if (symlink(wtdir.buf, rdir.buf)) {
if (create_symlink(lstate.istate, wtdir.buf, rdir.buf)) {
ret = error_errno("could not symlink '%s' to '%s'", wtdir.buf, rdir.buf);
goto finish;
}
Expand Down
4 changes: 2 additions & 2 deletions builtin/init-db.c
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ static void copy_templates_1(struct strbuf *path, struct strbuf *template_path,
if (strbuf_readlink(&lnk, template_path->buf,
st_template.st_size) < 0)
die_errno(_("cannot readlink '%s'"), template_path->buf);
if (symlink(lnk.buf, path->buf))
if (create_symlink(NULL, lnk.buf, path->buf))
die_errno(_("cannot symlink '%s' '%s'"),
lnk.buf, path->buf);
strbuf_release(&lnk);
Expand Down Expand Up @@ -278,7 +278,7 @@ static int create_default_files(const char *template_path,
path = git_path_buf(&buf, "tXXXXXX");
if (!close(xmkstemp(path)) &&
!unlink(path) &&
!symlink("testing", path) &&
!create_symlink(NULL, "testing", path) &&
!lstat(path, &st1) &&
S_ISLNK(st1.st_mode))
unlink(path); /* good */
Expand Down
Loading

0 comments on commit 684a739

Please sign in to comment.