fast-import: Improve robustness when D->F changes provided in wrong order
When older versions of fast-export came across a directory changing to a
symlink (or regular file), it would output the changes in the form
M 120000 :239821 dir-changing-to-symlink
D dir-changing-to-symlink/filename1
When fast-import sees the first line, it deletes the directory named
dir-changing-to-symlink (and any files below it) and creates a symlink in
its place. When fast-import came across the second line, it was previously
trying to remove the file and relevant leading directories in
tree_content_remove(), and as a side effect it would delete the symlink
that was just created. This resulted in the symlink silently missing from
the resulting repository.
To improve robustness, we ignore file deletions underneath directory names
that correspond to non-directories. This can also be viewed as a minor
optimization: since there cannot be a file and a directory with the same
name in the same directory, the file clearly can't exist so nothing needs
to be done to delete it.
Signed-off-by: Elijah Newren <newren@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
The fast-import stream format requires incremental changes which take place
immediately, meaning that for D->F conversions all files below the relevant
directory must be deleted before the resulting file of the same name is
created. Reversing the order can result in fast-import silently deleting
the file right after creating it, resulting in the file missing from the
resulting repository.
We correct this by first sorting the diff_queue_struct in depth-first
order.
Signed-off-by: Elijah Newren <newren@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
merge_recursive: Fix renames across paths below D/F conflicts
The rename logic in process_renames() handles renames and merging of file
contents and then marks files as processed. However, there may be higher
stage entries left in the index for other reasons (e.g., due to D/F
conflicts). By checking for such cases and marking the entry as not
processed, it allows process_entry() later to look at it and handle those
higher stages.
Signed-off-by: Elijah Newren <newren@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
The D/F conflicts that can be automatically resolved (file or directory
unmodified on one side of history), have the nice property that
process_entry() can correctly handle all subpaths of the D/F conflict. In
the case of D->F conversions, it will correctly delete all non-conflicting
files below the relevant directory and the directory itself (note that both
untracked and conflicting files below the directory will prevent its
removal). So if we handle D/F conflicts after all other conflicts, they
become fairly simple to handle -- we just need to check for whether or not
a path (file/directory) is in the way of creating the new content. We do
this by having process_entry() defer handling such entries to a subsequent
process_df_entry() step.
Signed-off-by: Elijah Newren <newren@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This is a simple testcase where both sides of the rename are paths involved
in (separate) D/F merge conflicts
Signed-off-by: Alexander Gladysh <agladysh@gmail.com> Signed-off-by: Elijah Newren <newren@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Documentation improvements for the description of short format.
Incorporates the detailed explanation from Jeff King in
<20100410040959.GA11977@coredump.intra.peff.net> and fixes
the bug noted by Junio C Hamano in
<7vmxxc1i8g.fsf@alter.siamese.dyndns.org>.
Signed-off-by: Eric S. Raymond <esr@thyrsus.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Documentation/Makefile: fix interrupted builds of user-manual.xml
Unlike gcc, asciidoc does not atomically write its output file or
delete it when interrupted. If it is interrupted in the middle of
writing an XML file, the result will be truncated input for xsltproc.
XSLTPROC user-manual.html
user-manual.xml:998: parser error : Premature end of data in t
Take care of this case by writing to a temporary and renaming it when
finished.
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Currently, there are 6 tests which are not even written but are
'test_expect_failure message false'.
Do not abuse test_expect_failure as a to do marker, but mark them as
'#TODO' instead.
Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net> Acked-by: Nguyen Thai Ngoc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* rr/remote-helper-doc:
Documentation/remote-helpers: Fix typos and improve language
Fixup: Second argument may be any arbitrary string
Documentation/remote-helpers: Add invocation section
Documentation/urls: Rewrite to accomodate <transport>::<address>
Documentation/remote-helpers: Rewrite description
* git://git.kernel.org/pub/scm/gitk/gitk:
gitk: Display dirty submodules correctly
gitk: Fix display of copyright symbol
gitk: Add emacs editor variable block
gitk: Avoid calling tk_setPalette on Windows
gitk: Don't clobber "Remember this view" setting
gitk: Add comments to explain encode_view_opts and decode_view_opts
gitk: Use consistent font for all text input fields
gitk: Set the font for all listbox widgets
gitk: Set the font for all spinbox widgets
gitk: Remove forced use of sans-serif font
gitk: Add Ctrl-W shortcut for closing the active window
Fixup: Second argument may be any arbitrary string
This is intended to be a fixup for commit ad466d1 in pu. As Jonathan
Neider pointed out, the second argument may be any arbitrary string,
and need not conform to any URL-like shape.
Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com> Acked-by: Sverre Rabbelier <srabbelier@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Documentation/urls: Rewrite to accomodate <transport>::<address>
Rewrite the first part of the document to explicitly show differences
between the URLs that can be used with different transport
protocols. Mention <transport>::<address> format to explicitly invoke
a remote helper.
Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com> Reviewed-by: Jonathan Nieder <jrnieder@gmail.com> Acked-by: Sverre Rabbelier <srabbelier@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Rewrite the description section to describe what exactly remote
helpers are and the need for them. Also mention the curl family of
remote helpers as an example.
[jc: with readability fixes from Jonathan squashed in]
Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com> Reviewed-by: Jonathan Nieder <jrnieder@gmail.com> Acked-by: Sverre Rabbelier <srabbelier@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
rebase-interactive: silence warning when no commits rewritten
If you do a "rebase -i" and don't change any commits,
nothing is rewritten, and we have no REWRITTEN_LIST. The
shell prints out an ugly message:
$ GIT_EDITOR=true git rebase -i HEAD^
/path/to/git-rebase--interactive: 1: cannot open
/path/to/repo/.git/rebase-merge/rewritten-list: No such file
Successfully rebased and updated refs/heads/master.
We can fix it by not running "notes copy" at all if nothing
was rewritten.
Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* maint:
t1010-mktree: Adjust expected result to code and documentation
combined diff: correctly handle truncated file
Document new "already-merged" rule for branch -d
git-instaweb: pass through invoking user's path to gitweb CGI scripts
When used with lighttpd or mongoose, git-instaweb previously passed a
hard-coded, default value of PATH to the gitweb CGI script. Use the invoking
user's value for PATH for this instead. (This is already implicitly the
behaviour for other web servers supported by git-instaweb.)
Signed-off-by: Chris Webb <chris@arachsys.com> Acked-by: Eric Wong <normalperson@yhbt.net>
gitweb: simplify gitweb.min.* generation and clean-up rules
GITWEB_CSS and GITWEB_JS are meant to be "what URI should the installed
cgi script use to refer to the stylesheet and JavaScript", never "this
is the name of the file we are building". Don't use them to decide what
file to build minified versions in.
While we are at it, lose FILES that is used only for "clean" target in a
misguided way. "make clean" should try to remove all the potential
build artifacts regardless of a minor configuration change. Instead of
trying to remove only the build product "make clean" would have created
if it were run without "clean", explicitly list the three potential build
products for removal.
Tested-by: Mark Rada <marada@uwaterloo.co> Signed-off-by: Junio C Hamano <gitster@pobox.com>
The only obvious observable effects I can think of are that the exec
is properly reported in GIT_TRACE output and that verifying signed
tags will still work if the git-verify-tag hard link in gitexecdir
goes missing.
Helped-by: Johannes Sixt <j6t@kdbg.org> Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
The description for core.autocrlf refers to reads from / writes to
"the filesystem", the only use of this rather ambiguous term, which
technically could be referring to the git object database. (All other
mentions are part of phrases such as "..filesystems (like NFS)..").
Other sections, including the section on core.safecrlf, use the term
"work tree" for the same purpose as the term "the filesystem" is used in
the core.autocrlf section, so that seems like a good alternative, which
makes it clearer what direction the addition/removal of CR characters
occurs in.
Signed-off-by: Will Palmer <wmpalmer@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
diff: use large integers for diffstat calculations
The diffstat "added" and "changed" fields generally store
line counts; however, for binary files, they store file
sizes. Since we store and print these values as ints, a
diffstat on a file larger than 2G can show a negative size.
Instead, let's use uintmax_t, which should be at least 64
bits on modern platforms.
Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
t1010-mktree: Adjust expected result to code and documentation
The last two tests here were always supposed to fail in the sense
that, according to code and documentation, mktree should read non-recursive
ls-tree output, but not recursive one, and therefore explicitely refuses
to deal with slashes.
Adjust the test (must_fail) so that it succeeds when mktree dies on
slashes.
Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Consider an evil merge of two commits A and B, both of which have a
file 'foo', but the merge result does not have that file.
The combined-diff code learned in 4462731 (combine-diff: do not punt
on removed or added files., 2006-02-06) to concisely show only the
removal, since that is the evil part and the previous contents are
presumably uninteresting.
However, to diagnose an empty merge result, it overloaded the variable
that holds the file's length. This means that the check also triggers
for truncated files. Consequently, such files were not shown in the
diff at all despite the merge being clearly evil.
Fix this by adding a new variable that distinguishes whether the file
was deleted (which is the case 4462731 handled) or truncated. In the
truncated case, we show the full combined diff again, which is rather
spammy but at least does not hide the evilness.
Reported-by: David Martínez Martí <desarrollo@gestiweb.com> Signed-off-by: Thomas Rast <trast@student.ethz.ch> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Since recently "git diff --submodule" prints out extra lines when the
submodule contains untracked or modified files. Show all those lines of
one submodule under the same header.
Also for newly added or removed submodules the submodule name contained
trailing garbage because the extraction of the name was not done right.
Signed-off-by: Jens Lehmann <Jens.Lehmann@web.de> Signed-off-by: Paul Mackerras <paulus@samba.org>
v1.7.0-rc0~18^2 (branch -d: base the "already-merged" safety on the
branch it merges with, 2009-12-29) taught ‘git branch’ a new heuristic
for when it is safe to delete a branch without forcing the issue. It
is safe to delete a branch "topic" without second thought if:
- the branch "topic" is set up to pull from a (remote-tracking,
usually) branch and is fully merged in that "upstream" branch, or
- there is no branch.topic.merge configuration and branch "topic" is
fully merged in the current HEAD.
Update the man page to acknowledge the new rules.
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
The makefile snippets that would land in these directories are already
being ignored. Ignore the directories instead so they don’t show up
in ‘git clean -n’ output.
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
When using git log --pretty='%N' without an explicit --show-notes, git
would segfault. This patches fixes this behaviour by loading the needed
notes datastructures if --pretty is used and the format contains %N.
When --pretty='%N' is used together with --no-notes, %N won't be
expanded.
This is an extension to a proposed patch by Jeff King.
Signed-off-by: Johannes Gilger <heipei@hackvalue.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Windows: start_command: Support non-NULL dir in struct child_process
A caller of start_command can set the member 'dir' to a directory to
request that the child process starts with that directory as CWD. The first
user of this feature was added recently in eee49b6 (Teach diff --submodule
and status to handle .git files in submodules).
On Windows, we have been lazy and had not implemented support for this
feature, yet. This fixes the shortcoming.
Signed-off-by: Johannes Sixt <j6t@kdbg.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* mr/gitweb-jsmin:
gitweb: update INSTALL to use shorter make target
gitweb: add documentation to INSTALL regarding gitweb.js
instaweb: add minification awareness
Gitweb: add autoconfigure support for minifiers
Gitweb: add support for minifying gitweb.css
Gitweb: add ignore and clean rules for minified files
Teach diff --submodule and status to handle .git files in submodules
The simple test for an existing .git directory gives an incorrect result
if .git is a file that records "gitdir: overthere". So for submodules that
use a .git file, "git status" and the diff family - when the "--submodule"
option is given - did assume the submodule was not populated at all when
a .git file was used, thus generating wrong output or no output at all.
This is fixed by using read_gitfile_gently() to get the correct location
of the .git directory. While at it, is_submodule_modified() was cleaned up
to use the "dir" member of "struct child_process" instead of setting the
GIT_WORK_TREE and GIT_DIR environment variables.
Signed-off-by: Jens Lehmann <Jens.Lehmann@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Let check_preimage() use memset() to initialize "struct checkout"
Every code site except check_preimage() uses either memset() or declares
a static instance of "struct checkout" to achieve proper initialization.
Lets use memset() instead of explicit initialization of all members here
too to be on the safe side in case this structure is expanded someday.
Signed-off-by: Jens Lehmann <Jens.Lehmann@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
- use "<options>" instead of just "options".
- use "[<repository> [<refspec>...]]" to indicate that <repository> and
<refspec> are optional, and that <refspec> cannot be specified
without specifying <repository>.
Note that when called without specifying <repository> (eg. "git fetch
-f"), it is accurate to say that the "git fetch [<options>]
[<repository> ...]" case takes precedence over "git fetch [<options>]
<group>".
Signed-off-by: Tay Ray Chuan <rctay89@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
branch: say "Reset to" in reflog entries for 'git branch -f' operations
In 5f856dd (fix reflog entries for "git-branch"), it is mentioned that
'git branch -f' is intended to be equivalent to 'git reset'. Since we
usually say "reset to <commit>" in the git-reset Documentation and
elsewhere, it would make sense to say "Reset to" here as well, instead
of "Reset from" previously.
Signed-off-by: Tay Ray Chuan <rctay89@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Even if you use imap-send to throw your drafts in the outbox, using their
web interface will mangle your patches. Clarify that the imap-send is
meant to be used together with a real MUA that can use IMAP drafts, and
remove instructions related to the web interface, which is irrelevant.
Add description of send-email as an alternative.
Use --cover-letter, and do not use -C nor --no-color, on the example
command line for format-patch.
* sb/fmt-merge-msg:
fmt-merge-msg: hide summary option
fmt-merge-msg: remove custom string_list implementation
string-list: add unsorted_string_list_lookup()
fmt-merge-msg: use pretty.c routines
t6200: test fmt-merge-msg more
t6200: modernize with test_tick
fmt-merge-msg: be quiet if nothing to merge
Could it be that you are using a third party iconv library?
I've experienced this on another system and the problem was related
to curl. In that case, curl was linked against an external iconv and
not the native library, so if I tried to build with curl support, I had
to also build against the external iconv library.
Handle perforations found “in the wild” more robustly by recognizing
“%<” as an alternative scissors mark.
This feature is only meant to support old habits. Discourage new use
of the percent-based version by only documenting the 8< symbol so new
users’ perforations can still be recognized by old versions of Git.
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>