gitweb.git
fsck_object(): allow passing object data separately... Johannes Schindelin Wed, 10 Sep 2014 13:52:51 +0000 (15:52 +0200)

fsck_object(): allow passing object data separately from the object itself

When fsck'ing an incoming pack, we need to fsck objects that cannot be
read via read_sha1_file() because they are not local yet (and might even
be rejected if transfer.fsckobjects is set to 'true').

For commits, there is a hack in place: we basically cache commit
objects' buffers anyway, but the same is not true, say, for tag objects.

By refactoring fsck_object() to take the object buffer and size as
optional arguments -- optional, because we still fall back to the
previous method to look at the cached commit objects if the caller
passes NULL -- we prepare the machinery for the upcoming handling of tag
objects.

The assumption that such buffers are inherently NUL terminated is now
wrong, of course, hence we pass the size of the buffer so that we can
add a sanity check later, to prevent running past the end of the buffer.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Refactor type_from_string() to allow continuing after... Johannes Schindelin Wed, 10 Sep 2014 13:52:44 +0000 (15:52 +0200)

Refactor type_from_string() to allow continuing after detecting an error

In the next commits, we will enhance the fsck_tag() function to check
tag objects more thoroughly. To this end, we need a function to verify
that a given string is a valid object type, but that does not die() in
the negative case.

While at it, prepare type_from_string() for counted strings, i.e. strings
with an explicitly specified length rather than a NUL termination.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

refs: write packed_refs file using stdioJeff King Wed, 10 Sep 2014 10:03:52 +0000 (06:03 -0400)

refs: write packed_refs file using stdio

We write each line of a new packed-refs file individually
using a write() syscall (and sometimes 2, if the ref is
peeled). Since each line is only about 50-100 bytes long,
this creates a lot of system call overhead.

We can instead open a stdio handle around our descriptor and
use fprintf to write to it. The extra buffering is not a
problem for us, because nobody will read our new packed-refs
file until we call commit_lock_file (by which point we have
flushed everything).

On a pathological repository with 8.5 million refs, this
dropped the time to run `git pack-refs` from 20s to 6s.

Signed-off-by: Jeff King <peff@peff.net>
Reviewed-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

fsck: exit with non-zero status upon error from fsck_obj()Jeff King Fri, 29 Aug 2014 20:31:46 +0000 (16:31 -0400)

fsck: exit with non-zero status upon error from fsck_obj()

Upon finding a corrupt loose object, we forgot to note the error to
signal it with the exit status of the entire process.

[jc: adjusted t1450 and added another test]

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Update draft release notes to 2.2Junio C Hamano Tue, 9 Sep 2014 20:06:26 +0000 (13:06 -0700)

Update draft release notes to 2.2

Signed-off-by: Junio C Hamano <gitster@pobox.com>

Merge branch 'sp/pack-protocol-doc-on-shallow'Junio C Hamano Tue, 9 Sep 2014 19:54:09 +0000 (12:54 -0700)

Merge branch 'sp/pack-protocol-doc-on-shallow'

* sp/pack-protocol-doc-on-shallow:
Document LF appearing in shallow command during send-pack/receive-pack

Merge branch 'tf/imap-send-create'Junio C Hamano Tue, 9 Sep 2014 19:54:08 +0000 (12:54 -0700)

Merge branch 'tf/imap-send-create'

* tf/imap-send-create:
imap-send: create target mailbox if it is missing
imap-send: clarify CRAM-MD5 vs LOGIN documentation

Merge branch 'jk/prompt-stash-could-be-packed'Junio C Hamano Tue, 9 Sep 2014 19:54:08 +0000 (12:54 -0700)

Merge branch 'jk/prompt-stash-could-be-packed'

The prompt script checked $GIT_DIR/ref/stash file to see if there
is a stash, which was a no-no.

* jk/prompt-stash-could-be-packed:
git-prompt: do not look for refs/stash in $GIT_DIR

Merge branch 'tb/pretty-format-cd-date-format'Junio C Hamano Tue, 9 Sep 2014 19:54:07 +0000 (12:54 -0700)

Merge branch 'tb/pretty-format-cd-date-format'

Documentation update.

* tb/pretty-format-cd-date-format:
pretty: note that %cd respects the --date= option

Merge branch 'rs/inline-compat-path-macros'Junio C Hamano Tue, 9 Sep 2014 19:54:07 +0000 (12:54 -0700)

Merge branch 'rs/inline-compat-path-macros'

* rs/inline-compat-path-macros:
turn path macros into inline function

Merge branch 'rs/clean-menu-item-defn'Junio C Hamano Tue, 9 Sep 2014 19:54:06 +0000 (12:54 -0700)

Merge branch 'rs/clean-menu-item-defn'

* rs/clean-menu-item-defn:
clean: use f(void) instead of f() to declare a pointer to a function without arguments

Merge branch 'jc/config-mak-document-darwin-vs-macosx'Junio C Hamano Tue, 9 Sep 2014 19:54:05 +0000 (12:54 -0700)

Merge branch 'jc/config-mak-document-darwin-vs-macosx'

* jc/config-mak-document-darwin-vs-macosx:
config.mak.uname: add hint on uname_R for MacOS X
config.mak.uname: set NO_APPLE_COMMON_CRYPTO on older systems

Merge branch 'sb/mailsplit-dead-code-removal'Junio C Hamano Tue, 9 Sep 2014 19:54:04 +0000 (12:54 -0700)

Merge branch 'sb/mailsplit-dead-code-removal'

* sb/mailsplit-dead-code-removal:
mailsplit.c: remove dead code

Merge branch 'so/rebase-doc'Junio C Hamano Tue, 9 Sep 2014 19:54:03 +0000 (12:54 -0700)

Merge branch 'so/rebase-doc'

May need further updates to the description to explain what makes
various modes of operation to decide that the request can become a
"no-op".

* so/rebase-doc:
Documentation/git-rebase.txt: -f forces a rebase that would otherwise be a no-op

Merge branch 'sb/prepare-revision-walk-error-check'Junio C Hamano Tue, 9 Sep 2014 19:54:03 +0000 (12:54 -0700)

Merge branch 'sb/prepare-revision-walk-error-check'

* sb/prepare-revision-walk-error-check:
prepare_revision_walk(): check for return value in all places

Merge branch 'sb/blame-msg-i18n'Junio C Hamano Tue, 9 Sep 2014 19:54:03 +0000 (12:54 -0700)

Merge branch 'sb/blame-msg-i18n'

* sb/blame-msg-i18n:
builtin/blame.c: add translation to warning about failed revision walk

Merge branch 'nd/strbuf-utf8-replace'Junio C Hamano Tue, 9 Sep 2014 19:54:02 +0000 (12:54 -0700)

Merge branch 'nd/strbuf-utf8-replace'

* nd/strbuf-utf8-replace:
utf8.c: fix strbuf_utf8_replace() consuming data beyond input string

Merge branch 'sb/plug-leaks'Junio C Hamano Tue, 9 Sep 2014 19:54:01 +0000 (12:54 -0700)

Merge branch 'sb/plug-leaks'

* sb/plug-leaks:
clone.c: don't leak memory in cmd_clone
remote.c: don't leak the base branch name in format_tracking_info

Merge branch 'rs/refresh-beyond-symlink'Junio C Hamano Tue, 9 Sep 2014 19:54:01 +0000 (12:54 -0700)

Merge branch 'rs/refresh-beyond-symlink'

"git add x" where x that used to be a directory has become a
symbolic link to a directory misbehaved.

* rs/refresh-beyond-symlink:
read-cache: check for leading symlinks when refreshing index

Merge branch 'la/init-doc'Junio C Hamano Tue, 9 Sep 2014 19:54:00 +0000 (12:54 -0700)

Merge branch 'la/init-doc'

* la/init-doc:
Documentation: git-init: flesh out example
Documentation: git-init: template directory: reword and cross-reference
Documentation: git-init: reword parenthetical statements
Documentation: git-init: --separate-git-dir: clarify
Documentation: git-init: template directory: reword
Documentation: git-init: list items facelift
Documentation: git-init: typographical fixes

Merge branch 'jk/stash-list-p'Junio C Hamano Tue, 9 Sep 2014 19:54:00 +0000 (12:54 -0700)

Merge branch 'jk/stash-list-p'

Teach "git stash list -p" to show the difference between the base
commit version and the working tree version, which is in line with
what "git show" gives.

* jk/stash-list-p:
stash: default listing to working-tree diff

Merge branch 'mm/log-branch-desc-plug-leak'Junio C Hamano Tue, 9 Sep 2014 19:53:59 +0000 (12:53 -0700)

Merge branch 'mm/log-branch-desc-plug-leak'

* mm/log-branch-desc-plug-leak:
builtin/log.c: fix minor memory leak

Merge branch 'lf/bundle-exclusion'Junio C Hamano Tue, 9 Sep 2014 19:53:58 +0000 (12:53 -0700)

Merge branch 'lf/bundle-exclusion'

"git bundle create" with date-range specification were meant to
exclude tags outside the range

* lf/bundle-exclusion:
bundle: fix exclusion of annotated tags

Merge branch 'jc/apply-ws-prefix'Junio C Hamano Tue, 9 Sep 2014 19:53:58 +0000 (12:53 -0700)

Merge branch 'jc/apply-ws-prefix'

Applying a patch not generated by Git in a subdirectory used to
check the whitespace breakage using the attributes for incorrect
paths. Also whitespace checks were performed even for paths
excluded via "git apply --exclude=<path>" mechanism.

* jc/apply-ws-prefix:
apply: omit ws check for excluded paths
apply: hoist use_patch() helper for path exclusion up
apply: use the right attribute for paths in non-Git patches

Merge branch 'jk/command-line-config-empty-string'Junio C Hamano Tue, 9 Sep 2014 19:53:56 +0000 (12:53 -0700)

Merge branch 'jk/command-line-config-empty-string'

"git -c section.var command" and "git -c section.var= command"
should pass the configuration differently (the former should be
a boolean true, the latter should be an empty string).

* jk/command-line-config-empty-string:
config: teach "git -c" to recognize an empty string

Merge branch 'bc/imap-send-doc'Junio C Hamano Tue, 9 Sep 2014 19:53:55 +0000 (12:53 -0700)

Merge branch 'bc/imap-send-doc'

* bc/imap-send-doc:
imap-send doc: omit confusing "to use imap-send" modifier

Merge branch 'jc/not-mingw-cygwin'Junio C Hamano Tue, 9 Sep 2014 19:53:54 +0000 (12:53 -0700)

Merge branch 'jc/not-mingw-cygwin'

We have been using NOT_{MINGW,CYGWIN} test prerequisites long
before Peff invented support for negated prerequisites e.g. !MINGW
and we still add more uses of the former. Convert them to the
latter to avoid confusion.

* jc/not-mingw-cygwin:
test prerequisites: enumerate with commas
test prerequisites: eradicate NOT_FOO

strbuf: use strbuf_addchars() for adding a char multipl... René Scharfe Sun, 7 Sep 2014 07:06:42 +0000 (09:06 +0200)

strbuf: use strbuf_addchars() for adding a char multiple times

Signed-off-by: Rene Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

strbuf: export strbuf_addchars()René Scharfe Sun, 7 Sep 2014 07:03:32 +0000 (09:03 +0200)

strbuf: export strbuf_addchars()

Move strbuf_addchars() to strbuf.c, where it belongs, and make it
available for other callers.

Signed-off-by: Rene Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

trace: correct trace_strbuf() parameter type for !HAVE_... René Scharfe Sat, 6 Sep 2014 20:53:03 +0000 (22:53 +0200)

trace: correct trace_strbuf() parameter type for !HAVE_VARIADIC_MACROS

Reported-by: dev <dev@cor0.com>
Signed-off-by: Rene Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

parse-options: detect attempt to add a duplicate short... Junio C Hamano Wed, 3 Sep 2014 19:42:37 +0000 (12:42 -0700)

parse-options: detect attempt to add a duplicate short option name

It is easy to overlook an already assigned single-letter option name
and try to use it for a new one. Help the developer to catch it
before such a mistake escapes the lab.

This retroactively forbids any short option name (which is defined
to be of type "int") outside the ASCII printable range. We might
want to do one of two things:

- tighten the type of short_name member to 'char', and further
update optbug() to protect it against doing "'%c'" on a funny
value, e.g. negative or above 127.

- drop the check (even the "duplicate" check) for an option whose
short_name is either negative or above 255, to allow clever folks
to take advantage of the fact that such a short_name cannot be
parsed from the command line and the member can be used to store
some extra information.

Helped-by: René Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

mv: no SP between function name and the first opening... Nguyễn Thái Ngọc Duy Sun, 10 Aug 2014 02:29:36 +0000 (09:29 +0700)

mv: no SP between function name and the first opening parenthese

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

mv: combine two if(s)Nguyễn Thái Ngọc Duy Sun, 10 Aug 2014 02:29:35 +0000 (09:29 +0700)

mv: combine two if(s)

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

mv: unindent one level for directory move codeNguyễn Thái Ngọc Duy Sun, 10 Aug 2014 02:29:34 +0000 (09:29 +0700)

mv: unindent one level for directory move code

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

mv: move index search code outNguyễn Thái Ngọc Duy Sun, 10 Aug 2014 02:29:33 +0000 (09:29 +0700)

mv: move index search code out

"Huh?" is removed from die() message.

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

mv: remove an "if" that's always trueNguyễn Thái Ngọc Duy Sun, 10 Aug 2014 02:29:32 +0000 (09:29 +0700)

mv: remove an "if" that's always true

This is inside an "else" block of "if (last - first < 1)", so we know
that "last - first >= 1" when we come here. No need to check
"last - first > 0".

While at there, save "argc + last - first" to a variable to shorten
the statements a bit.

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

mv: split submodule move preparation code outNguyễn Thái Ngọc Duy Sun, 10 Aug 2014 02:29:31 +0000 (09:29 +0700)

mv: split submodule move preparation code out

"Huh?" is removed from die() message.

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

calloc() and xcalloc() takes nmemb and then sizeArjun Sreedharan Sat, 30 Aug 2014 06:54:23 +0000 (12:24 +0530)

calloc() and xcalloc() takes nmemb and then size

There are a handful more instances of this in compat/regex/ but they
are borrowed code taht we do not want to touch with a change that
really affects correctness, which this change is not.

Signed-off-by: Arjun Sreedharan <arjun024@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

completion: Add --ignore-blank-lines for diffThomas Braun Wed, 3 Sep 2014 15:00:41 +0000 (17:00 +0200)

completion: Add --ignore-blank-lines for diff

Signed-off-by: Thomas Braun <thomas.braun@virtuell-zuhause.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

reachable.c: add HEAD to reachability starting commitsMax Kirillov Wed, 3 Sep 2014 16:14:10 +0000 (19:14 +0300)

reachable.c: add HEAD to reachability starting commits

HEAD is not explicitly used as a starting commit for
calculating reachability, so if it's detached and reflogs
are disabled it may be pruned.

Add tests which demonstrate it. Test 'prune: prune former HEAD after checking
out branch' also reverts changes to repository.

Signed-off-by: Max Kirillov <max@max630.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

cache-tree: do not try to use an invalidated subtree... Junio C Hamano Tue, 2 Sep 2014 21:16:20 +0000 (14:16 -0700)

cache-tree: do not try to use an invalidated subtree info to build a tree

We punt from repairing the cache-tree during a branch switching if
it involves having to create a new tree object that does not yet
exist in the object store. "mkdir dir && >dir/file && git add dir"
followed by "git checkout" is one example, when a tree that records
the state of such "dir/" is not in the object store.

However, after discovering that we do not have a tree object that
records the state of "dir/", the caller failed to remember the fact
that it noticed the cache-tree entry it received for "dir/" is
invalidated, it already knows it should not be populating the level
that has "dir/" as its immediate subdirectory, and it is not an
error at all for the sublevel cache-tree entry gave it a bogus
object name it shouldn't even look at.

This led the caller to detect and report a non-existent error. The
end result was the same and we avoided stuffing a non-existent tree
to the cache-tree, but we shouldn't have issued an alarming error
message to the user.

Signed-off-by: Junio C Hamano <gitster@pobox.com>

update-ref --stdin: pass transaction around explicitlyJonathan Nieder Tue, 2 Sep 2014 21:11:21 +0000 (14:11 -0700)

update-ref --stdin: pass transaction around explicitly

This makes it more obvious at a glance where the output of functions
parsing the --stdin stream goes.

No functional change intended.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Reviewed-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

update-ref --stdin: narrow scope of err strbufJonathan Nieder Tue, 2 Sep 2014 21:10:52 +0000 (14:10 -0700)

update-ref --stdin: narrow scope of err strbuf

Making the strbuf local in each function that needs to print errors
saves the reader from having to think about action at a distance,
such as

* errors piling up and being concatenated with no newline between
them
* errors unhandled in one function, to be later handled in another
* concurrency issues, if this code starts using threads some day

No functional change intended.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Reviewed-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

refs.c: make delete_ref use a transactionRonnie Sahlberg Wed, 30 Apr 2014 16:22:45 +0000 (09:22 -0700)

refs.c: make delete_ref use a transaction

Change delete_ref to use a ref transaction for the deletion. At the same time
since we no longer have any callers of repack_without_ref we can now delete
this function.

Change delete_ref to return 0 on success and 1 on failure instead of the
previous 0 on success either 1 or -1 on failure.

Signed-off-by: Ronnie Sahlberg <sahlberg@google.com>
Reviewed-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

refs.c: make prune_ref use a transaction to delete... Ronnie Sahlberg Wed, 30 Apr 2014 16:03:36 +0000 (09:03 -0700)

refs.c: make prune_ref use a transaction to delete the ref

Change prune_ref to delete the ref using a ref transaction. To do this we also
need to add a new flag REF_ISPRUNING that will tell the transaction that we
do not want to delete this ref from the packed refs. This flag is private to
refs.c and not exposed to external callers.

Signed-off-by: Ronnie Sahlberg <sahlberg@google.com>
Reviewed-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

refs.c: remove lock_ref_sha1Ronnie Sahlberg Tue, 29 Apr 2014 22:45:52 +0000 (15:45 -0700)

refs.c: remove lock_ref_sha1

lock_ref_sha1 was only called from one place in refs.c and only provided
a check that the refname was sane before adding back the initial "refs/"
part of the ref path name, the initial "refs/" that this caller had already
stripped off before calling lock_ref_sha1.

Signed-off-by: Ronnie Sahlberg <sahlberg@google.com>
Reviewed-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

refs.c: remove the update_ref_write functionRonnie Sahlberg Tue, 29 Apr 2014 20:42:07 +0000 (13:42 -0700)

refs.c: remove the update_ref_write function

Since we only call update_ref_write from a single place and we only call it
with onerr==QUIET_ON_ERR we can just as well get rid of it and just call
write_ref_sha1 directly. This changes the return status for _commit from
1 to -1 on failures when writing to the ref. Eventually we will want
_commit to start returning more detailed error conditions than the current
simple success/failure.

Signed-off-by: Ronnie Sahlberg <sahlberg@google.com>
Reviewed-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

refs.c: remove the update_ref_lock functionRonnie Sahlberg Tue, 29 Apr 2014 19:14:47 +0000 (12:14 -0700)

refs.c: remove the update_ref_lock function

Since we now only call update_ref_lock with onerr==QUIET_ON_ERR we no longer
need this function and can replace it with just calling lock_any_ref_for_update
directly.

Signed-off-by: Ronnie Sahlberg <sahlberg@google.com>
Reviewed-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

refs.c: make lock_ref_sha1 staticRonnie Sahlberg Mon, 28 Apr 2014 22:38:47 +0000 (15:38 -0700)

refs.c: make lock_ref_sha1 static

No external callers reference lock_ref_sha1 any more so let's declare it
static.

Signed-off-by: Ronnie Sahlberg <sahlberg@google.com>
Reviewed-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

walker.c: use ref transaction for ref updatesRonnie Sahlberg Thu, 17 Apr 2014 18:31:06 +0000 (11:31 -0700)

walker.c: use ref transaction for ref updates

Switch to using ref transactions in walker_fetch(). As part of the refactoring
to use ref transactions we also fix a potential memory leak where in the
original code if write_ref_sha1() would fail we would end up returning from
the function without free()ing the msg string.

Note that this function is only called when fetching from a remote HTTP
repository onto the local (most of the time single-user) repository which
likely means that the type of collisions that the previous locking would
protect against and cause the fetch to fail for are even more rare.

Signed-off-by: Ronnie Sahlberg <sahlberg@google.com>
Reviewed-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

fast-import.c: use a ref transaction when dumping tagsRonnie Sahlberg Mon, 28 Apr 2014 22:23:58 +0000 (15:23 -0700)

fast-import.c: use a ref transaction when dumping tags

Signed-off-by: Ronnie Sahlberg <sahlberg@google.com>
Reviewed-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

receive-pack.c: use a reference transaction for updatin... Ronnie Sahlberg Mon, 28 Apr 2014 21:36:15 +0000 (14:36 -0700)

receive-pack.c: use a reference transaction for updating the refs

Wrap all the ref updates inside a transaction.

In the new API there is no distinction between failure to lock and
failure to write a ref. Both can be permanent (e.g., a ref
"refs/heads/topic" is blocking creation of the lock file
"refs/heads/topic/1.lock") or transient (e.g., file system full) and
there's no clear difference in how the client should respond, so
replace the two statuses "failed to lock" and "failed to write" with
a single status "failed to update ref". In both cases a more
detailed message is sent by sideband to diagnose the problem.

Example, before:

error: there are still refs under 'refs/heads/topic'
remote: error: failed to lock refs/heads/topic
To foo
! [remote rejected] HEAD -> topic (failed to lock)

After:

error: there are still refs under 'refs/heads/topic'
remote: error: Cannot lock the ref 'refs/heads/topic'.
To foo
! [remote rejected] HEAD -> topic (failed to update ref)

Signed-off-by: Ronnie Sahlberg <sahlberg@google.com>
Reviewed-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

refs.c: change update_ref to use a transactionRonnie Sahlberg Thu, 24 Apr 2014 23:36:55 +0000 (16:36 -0700)

refs.c: change update_ref to use a transaction

Change the update_ref helper function to use a ref transaction internally.

Signed-off-by: Ronnie Sahlberg <sahlberg@google.com>
Reviewed-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

branch.c: use ref transaction for all ref updatesRonnie Sahlberg Wed, 16 Apr 2014 23:21:53 +0000 (16:21 -0700)

branch.c: use ref transaction for all ref updates

Change create_branch to use a ref transaction when creating the new branch.

This also fixes a race condition in the old code where two concurrent
create_branch could race since the lock_any_ref_for_update/write_ref_sha1
did not protect against the ref already existing. I.e. one thread could end up
overwriting a branch even if the forcing flag is false.

Signed-off-by: Ronnie Sahlberg <sahlberg@google.com>
Reviewed-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

fast-import.c: change update_branch to use ref transactionsRonnie Sahlberg Wed, 16 Apr 2014 23:21:13 +0000 (16:21 -0700)

fast-import.c: change update_branch to use ref transactions

Change update_branch() to use ref transactions for updates.

Signed-off-by: Ronnie Sahlberg <sahlberg@google.com>
Reviewed-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

sequencer.c: use ref transactions for all ref updatesRonnie Sahlberg Wed, 16 Apr 2014 22:37:45 +0000 (15:37 -0700)

sequencer.c: use ref transactions for all ref updates

Change to use ref transactions for all updates to refs.

Signed-off-by: Ronnie Sahlberg <sahlberg@google.com>
Reviewed-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

commit.c: use ref transactions for updatesRonnie Sahlberg Wed, 16 Apr 2014 22:34:19 +0000 (15:34 -0700)

commit.c: use ref transactions for updates

Change commit.c to use ref transactions for all ref updates.
Make sure we pass a NULL pointer to ref_transaction_update if have_old
is false.

Signed-off-by: Ronnie Sahlberg <sahlberg@google.com>
Reviewed-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

replace.c: use the ref transaction functions for updatesRonnie Sahlberg Wed, 16 Apr 2014 22:32:29 +0000 (15:32 -0700)

replace.c: use the ref transaction functions for updates

Update replace.c to use ref transactions for updates.

Signed-off-by: Ronnie Sahlberg <sahlberg@google.com>
Reviewed-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

tag.c: use ref transactions when doing updatesRonnie Sahlberg Wed, 16 Apr 2014 22:30:41 +0000 (15:30 -0700)

tag.c: use ref transactions when doing updates

Change tag.c to use ref transactions for all ref updates.

Signed-off-by: Ronnie Sahlberg <sahlberg@google.com>
Reviewed-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

refs.c: add transaction.status and track OPEN/CLOSEDRonnie Sahlberg Tue, 29 Apr 2014 19:06:19 +0000 (12:06 -0700)

refs.c: add transaction.status and track OPEN/CLOSED

Track the state of a transaction in a new state field. Check the field for
sanity, i.e. that state must be OPEN when _commit/_create/_delete or
_update is called or else die(BUG:...)

Signed-off-by: Ronnie Sahlberg <sahlberg@google.com>
Reviewed-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

refs.c: make ref_transaction_begin take an err argumentRonnie Sahlberg Mon, 19 May 2014 17:42:34 +0000 (10:42 -0700)

refs.c: make ref_transaction_begin take an err argument

Add an err argument to _begin so that on non-fatal failures in future ref
backends we can report a nice error back to the caller.
While _begin can currently never fail for other reasons than OOM, in which
case we die() anyway, we may add other types of backends in the future.
For example, a hypothetical MySQL backend could fail in _begin with
"Can not connect to MySQL server. No route to host".

Signed-off-by: Ronnie Sahlberg <sahlberg@google.com>
Reviewed-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

refs.c: update ref_transaction_delete to check for... Ronnie Sahlberg Wed, 16 Apr 2014 22:27:45 +0000 (15:27 -0700)

refs.c: update ref_transaction_delete to check for error and return status

Change ref_transaction_delete() to do basic error checking and return
non-zero on error. Update all callers to check the return for
ref_transaction_delete(). There are currently no conditions in _delete that
will return error but there will be in the future. Add an err argument that
will be updated on failure.

Signed-off-by: Ronnie Sahlberg <sahlberg@google.com>
Reviewed-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

refs.c: change ref_transaction_create to do error check... Ronnie Sahlberg Wed, 16 Apr 2014 22:26:44 +0000 (15:26 -0700)

refs.c: change ref_transaction_create to do error checking and return status

Do basic error checking in ref_transaction_create() and make it return
non-zero on error. Update all callers to check the result of
ref_transaction_create(). There are currently no conditions in _create that
will return error but there will be in the future. Add an err argument that
will be updated on failure.

Signed-off-by: Ronnie Sahlberg <sahlberg@google.com>
Reviewed-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Start the post-2.1 cycleJunio C Hamano Tue, 2 Sep 2014 20:30:13 +0000 (13:30 -0700)

Start the post-2.1 cycle

Signed-off-by: Junio C Hamano <gitster@pobox.com>

Merge branch 'rs/strbuf-getcwd'Junio C Hamano Tue, 2 Sep 2014 20:27:45 +0000 (13:27 -0700)

Merge branch 'rs/strbuf-getcwd'

Reduce the use of fixed sized buffer passed to getcwd() calls
by introducing xgetcwd() helper.

* rs/strbuf-getcwd:
use strbuf_add_absolute_path() to add absolute paths
abspath: convert absolute_path() to strbuf
use xgetcwd() to set $GIT_DIR
use xgetcwd() to get the current directory or die
wrapper: add xgetcwd()
abspath: convert real_path_internal() to strbuf
abspath: use strbuf_getcwd() to remember original working directory
setup: convert setup_git_directory_gently_1 et al. to strbuf
unix-sockets: use strbuf_getcwd()
strbuf: add strbuf_getcwd()

Merge branch 'ta/pretty-parse-config'Junio C Hamano Tue, 2 Sep 2014 20:27:39 +0000 (13:27 -0700)

Merge branch 'ta/pretty-parse-config'

* ta/pretty-parse-config:
pretty.c: make git_pretty_formats_config return -1 on git_config_string failure

Merge branch 'bc/archive-pax-header-mode'Junio C Hamano Tue, 2 Sep 2014 20:27:12 +0000 (13:27 -0700)

Merge branch 'bc/archive-pax-header-mode'

Implementations of "tar" that do not understand an extended pax
header would extract the contents of it in a regular file; make
sure the permission bits of this file follows the same tar.umask
configuration setting.

* bc/archive-pax-header-mode:
archive: honor tar.umask even for pax headers

Merge branch 'pr/remotes-in-hashmap'Junio C Hamano Tue, 2 Sep 2014 20:26:37 +0000 (13:26 -0700)

Merge branch 'pr/remotes-in-hashmap'

Optimize remotes configuration look-up in a repository with very
many remotes defined.

* pr/remotes-in-hashmap:
use a hashmap to make remotes faster

Merge branch 'jk/pretty-empty-format'Junio C Hamano Tue, 2 Sep 2014 20:25:03 +0000 (13:25 -0700)

Merge branch 'jk/pretty-empty-format'

"git log --pretty/format=" with an empty format string did not mean
the more obvious "No output whatsoever" but "Use default format",
which was counterintuitive.

* jk/pretty-empty-format:
pretty: make empty userformats truly empty
pretty: treat "--format=" as an empty userformat
revision: drop useless string offset when parsing "--pretty"

Merge branch 'ta/config-set'Junio C Hamano Tue, 2 Sep 2014 20:24:17 +0000 (13:24 -0700)

Merge branch 'ta/config-set'

Add in-core caching layer to let us avoid reading the same
configuration files number of times.

* ta/config-set:
test-config: add tests for the config_set API
add `config_set` API for caching config-like files

Merge branch 'rs/init-no-duplicate-real-path'Junio C Hamano Tue, 2 Sep 2014 20:24:04 +0000 (13:24 -0700)

Merge branch 'rs/init-no-duplicate-real-path'

* rs/init-no-duplicate-real-path:
init: avoid superfluous real_path() calls

Merge branch 'mm/config-edit-global'Junio C Hamano Tue, 2 Sep 2014 20:23:19 +0000 (13:23 -0700)

Merge branch 'mm/config-edit-global'

Start "git config --edit --global" from a skeletal per-user
configuration file contents, instead of a total blank, when the
user does not already have any. This immediately reduces the need
for a later "Have you forgotten setting core.user?" and we can add
more to the template as we gain more experience.

* mm/config-edit-global:
commit: advertise config --global --edit on guessed identity
home_config_paths(): let the caller ignore xdg path
config --global --edit: create a template file if needed

Merge branch 'jc/reopen-lock-file'Junio C Hamano Tue, 2 Sep 2014 20:20:12 +0000 (13:20 -0700)

Merge branch 'jc/reopen-lock-file'

There are cases where you lock and open to write a file, close it to
show the updated contents to external processes, and then have to
update the file again while still holding the lock, but the lockfile
API lacked support for such an access pattern.

* jc/reopen-lock-file:
lockfile: allow reopening a closed but still locked file

imap-send: simplify v_issue_imap_cmd() and get_cmd_resu... René Scharfe Sat, 30 Aug 2014 16:14:24 +0000 (18:14 +0200)

imap-send: simplify v_issue_imap_cmd() and get_cmd_result() using starts_with()

Use starts_with() instead of memcmp() to check if NUL-terminated
strings match prefixes. This gets rid of some magic string length
constants.

Signed-off-by: Rene Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

MinGW: update tests to handle a native eol of crlfBrice Lambson Sat, 30 Aug 2014 21:39:07 +0000 (23:39 +0200)

MinGW: update tests to handle a native eol of crlf

Some of the tests were written with the assumption that the native
eol would always be lf. After defining NATIVE_CRLF on MinGW, these
tests began failing. This change will update the tests to also
handle a native eol of crlf.

Signed-off-by: Brice Lambson <bricelam@live.com>
Helped-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Torsten Bögershausen <tboegi@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Makefile: propagate NATIVE_CRLF to CPat Thoyts Sat, 30 Aug 2014 21:38:59 +0000 (23:38 +0200)

Makefile: propagate NATIVE_CRLF to C

Commit 95f31e9a (convert: The native line-ending is \r\n on MinGW,
2010-09-04) correctly points out that the NATIVE_CRLF setting is
incorrectly set on Mingw git. However, the Makefile variable is not
propagated to the C preprocessor and results in no change. This patch
pushes the definition to the C code and adds a test to validate that
when core.eol as native is crlf, we actually normalize text files to
this line ending convention when core.autocrlf is false.

Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
Signed-off-by: Stepan Kasal <kasal@ucw.cz>
Signed-off-by: Torsten Bögershausen <tboegi@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

grammofix in user-facing messagesAlex Henrie Sat, 30 Aug 2014 19:56:01 +0000 (13:56 -0600)

grammofix in user-facing messages

Signed-off-by: Alex Henrie <alexhenrie24@gmail.com>
Acked-by: Johan Herland <johan@herland.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

stylefix: asterisks stick to the variable, not the... David Aguilar Sun, 31 Aug 2014 20:11:31 +0000 (13:11 -0700)

stylefix: asterisks stick to the variable, not the type

Signed-off-by: David Aguilar <davvid@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

merge-tree: remove unused df_conflict argumentsRené Scharfe Sat, 30 Aug 2014 21:40:34 +0000 (23:40 +0200)

merge-tree: remove unused df_conflict arguments

merge_trees_recursive() stores a pointer to its parameter df_conflict in
its struct traverse_info, but it is never actually used. Stop doing
that, remove the parameter and inline the function into merge_trees(),
as the latter is now only passing on its parameters.

Remove the parameter df_conflict from unresolved_directory() as well,
now that there is no way to pass it to merge_trees_recursive() through
that function anymore.

Signed-off-by: Rene Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

http-walker: simplify process_alternates_response(... René Scharfe Sat, 30 Aug 2014 15:55:45 +0000 (17:55 +0200)

http-walker: simplify process_alternates_response() using strbuf

Use strbuf to build the new base, which takes care of allocations and
the terminating NUL character automatically.

Signed-off-by: Rene Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

config: simplify git_config_include()René Scharfe Sat, 30 Aug 2014 16:07:05 +0000 (18:07 +0200)

config: simplify git_config_include()

Instead of using skip_prefix() to check the first part of the string
and then strcmp() to check the rest, simply use strcmp() to check the
whole string.

Signed-off-by: Rene Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

pack-write: simplify index_pack_lockfile using skip_pre... René Scharfe Sat, 30 Aug 2014 09:47:19 +0000 (11:47 +0200)

pack-write: simplify index_pack_lockfile using skip_prefix() and xstrfmt()

Get rid of magic string length constants by using skip_prefix() instead
of memcmp() and use xstrfmt() for building a string instead of a
PATH_MAX-sized buffer, snprintf() and xstrdup().

Signed-off-by: Rene Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

connect: simplify check_ref() using skip_prefix() and... René Scharfe Sat, 30 Aug 2014 09:46:54 +0000 (11:46 +0200)

connect: simplify check_ref() using skip_prefix() and starts_with()

Both callers of check_ref() pass in NUL-terminated strings for name.
Remove the len parameter and then use skip_prefix() and starts_with()
instead of memcmp() to check if it starts with certain strings. This
gets rid of several magic string length constants and a strlen() call.

Signed-off-by: Rene Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

index-pack: fix race condition with duplicate basesJeff King Fri, 29 Aug 2014 20:57:47 +0000 (16:57 -0400)

index-pack: fix race condition with duplicate bases

When we are resolving deltas in an indexed pack, we do it by
first selecting a potential base (either one stored in full
in the pack, or one created by resolving another delta), and
then resolving any deltas that use that base. When we
resolve a particular delta, we flip its "real_type" field
from OBJ_{REF,OFS}_DELTA to whatever the real type is.

We assume that traversing the objects this way will visit
each delta only once. This is correct for most packs; we
visit the delta only when we process its base, and each
object (and thus each base) appears only once. However, if a
base object appears multiple times in the pack, we will try
to resolve any deltas based on it once for each instance.

We can detect this case by noting that a delta we are about
to resolve has already had its real_type field flipped, and
we already do so with an assert(). However, if multiple
threads are in use, we may race with another thread on
comparing and flipping the field. We need to synchronize the
access.

The right mechanism for doing this is a compare-and-swap (we
atomically "claim" the delta for our own and find out
whether our claim was successful). We can implement this
in C by using a pthread mutex to protect the operation. This
is not the fastest way of doing a compare-and-swap; many
processors provide instructions for this, and gcc and other
compilers provide builtins to access them. However, some
experiments showed that lock contention does not cause a
significant slowdown here. Adding c-a-s support for many
compilers would increase the maintenance burden (and we
would still end up including the pthread version as a
fallback).

Note that we only need to touch the OBJ_REF_DELTA codepath
here. An OBJ_OFS_DELTA object points to its base using an
offset, and therefore has only one base, even if another
copy of that base object appears in the pack (we do still
touch it briefly because the setting of real_type is
factored out of resolve_data).

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

pretty: provide a strict ISO 8601 date formatBeat Bolli Fri, 29 Aug 2014 16:58:42 +0000 (18:58 +0200)

pretty: provide a strict ISO 8601 date format

Git's "ISO" date format does not really conform to the ISO 8601
standard due to small differences, and it cannot be parsed by ISO
8601-only parsers, e.g. those of XML toolchains.

The output from "--date=iso" deviates from ISO 8601 in these ways:

- a space instead of the `T` date/time delimiter
- a space between time and time zone
- no colon between hours and minutes of the time zone

Add a strict ISO 8601 date format for displaying committer and
author dates. Use the '%aI' and '%cI' format specifiers and add
'--date=iso-strict' or '--date=iso8601-strict' date format names.

See http://thread.gmane.org/gmane.comp.version-control.git/255879 and
http://thread.gmane.org/gmane.comp.version-control.git/52414/focus=52585
for discussion.

Signed-off-by: Beat Bolli <bbolli@ewanet.ch>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

determine_author_info(): copy getenv outputJeff King Wed, 27 Aug 2014 07:57:56 +0000 (03:57 -0400)

determine_author_info(): copy getenv output

When figuring out the author name for a commit, we may end
up either pointing to const storage from getenv("GIT_AUTHOR_*"),
or to newly allocated storage based on an existing commit or
the --author option.

Using const pointers to getenv's return has two problems:

1. It is not guaranteed that the return value from getenv
remains valid across multiple calls.

2. We do not know whether to free the values at the end,
so we just leak them.

We can solve both by duplicating the string returned by
getenv().

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

determine_author_info(): reuse parsing functionsJeff King Wed, 27 Aug 2014 07:57:28 +0000 (03:57 -0400)

determine_author_info(): reuse parsing functions

Rather than parsing the header manually to find the "author"
field, and then parsing its sub-parts, let's use
find_commit_header and split_ident_line. This is shorter and
easier to read, and should do a more careful parsing job.

For example, the current parser could find the end-of-email
right-bracket across a newline (for a malformed commit), and
calculate a bogus gigantic length for the date (by using
"eol - rb").

As a bonus, this also plugs a memory leak when we pull the
date field from an existing commit (we still leak the name
and email buffers, which will be fixed in a later commit).

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

fast-import: fix segfault in store_tree()Maxim Bublis Fri, 29 Aug 2014 11:53:37 +0000 (15:53 +0400)

fast-import: fix segfault in store_tree()

Branch tree is NULLified by filedelete command if we are trying
to delete root tree. Add sanity check and use load_tree() in that case.

Signed-off-by: Maxim Bublis <satori@yandex-team.ru>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t9300: test filedelete commandMaxim Bublis Fri, 29 Aug 2014 11:53:36 +0000 (15:53 +0400)

t9300: test filedelete command

Add new fast-import test series for filedelete command.

Signed-off-by: Maxim Bublis <satori@yandex-team.ru>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Merge git://github.com/git-l10n/git-poJunio C Hamano Fri, 29 Aug 2014 17:18:22 +0000 (10:18 -0700)

Merge git://github.com/git-l10n/git-po

* git://github.com/git-l10n/git-po:
po/TEAMS: add new members to German translation team
l10n: de.po: translate 38 new messages

read_index_unmerged(): remove unnecessary loop index... Jaime Soriano Pastor Wed, 27 Aug 2014 19:48:12 +0000 (21:48 +0200)

read_index_unmerged(): remove unnecessary loop index adjustment

Signed-off-by: Jaime Soriano Pastor <jsorianopastor@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

read_index_from(): catch out of order entries when... Jaime Soriano Pastor Fri, 29 Aug 2014 08:54:41 +0000 (10:54 +0200)

read_index_from(): catch out of order entries when reading an index file

Signed-off-by: Jaime Soriano Pastor <jsorianopastor@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

po/TEAMS: add new members to German translation teamRalf Thielow Tue, 26 Aug 2014 16:54:30 +0000 (18:54 +0200)

po/TEAMS: add new members to German translation team

Signed-off-by: Ralf Thielow <ralf.thielow@gmail.com>

l10n: de.po: translate 38 new messagesRalf Thielow Fri, 20 Jun 2014 15:22:48 +0000 (17:22 +0200)

l10n: de.po: translate 38 new messages

Translate 38 new messages came from git.pot update in fe05e19
(l10n: git.pot: v2.1.0 round 1 (38 new, 9 removed)).

Signed-off-by: Ralf Thielow <ralf.thielow@gmail.com>

contrib/svn-fe: fix MakefileMaxim Bublis Thu, 28 Aug 2014 17:00:49 +0000 (21:00 +0400)

contrib/svn-fe: fix Makefile

Fixes several problems:
* include config.mak.uname, config.mak.autogen and config.mak
in order to use settings for prefix and other such things;
* link xdiff/lib.a as it is a requirement for libgit.a;
* fix CFLAGS, LDFLAGS and EXTLIBS for Linux and Mac OS X.

Signed-off-by: Maxim Bublis <satori@yandex-team.ru>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Document LF appearing in shallow command during send... Shawn Pearce Wed, 27 Aug 2014 20:46:56 +0000 (13:46 -0700)

Document LF appearing in shallow command during send-pack/receive-pack

The implementation sends an LF, but the protocol documentation was
missing this detail.

Signed-off-by: Shawn Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t0027: Tests for core.eol=native, eol=lf, eol=crlfTorsten Bögershausen Sat, 16 Aug 2014 20:16:58 +0000 (22:16 +0200)

t0027: Tests for core.eol=native, eol=lf, eol=crlf

Add test cases for core.eol "native" and "" (unset).
(MINGW uses CRLF, all other systems LF as native line endings)

Add test cases for the attributes "eol=lf" and "eol=crlf"

Other minor changes:
- Use the more portable 'tr' instead of 'od -c' to convert '\n' into 'Q'
and '\0' into 'N'
- Style fixes for shell functions according to the coding guide lines
- Replace "txtbin" with "attr"

Signed-off-by: Torsten Bögershausen <tboegi@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

docs/fast-export: explain --anonymize more completelyJeff King Thu, 28 Aug 2014 12:32:58 +0000 (08:32 -0400)

docs/fast-export: explain --anonymize more completely

The original commit made mention of this option, but not why
one might want it or how they might use it. Let's try to be
a little more thorough, and also explain how to confirm that
the output really is anonymous.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

merge, pull: stop advising 'commit -a' in case of conflictMatthieu Moy Thu, 28 Aug 2014 09:46:58 +0000 (11:46 +0200)

merge, pull: stop advising 'commit -a' in case of conflict

'git commit -a' is rarely a good way to mark conflicts as resolved:
the user anyway has to go manually through the list of conflicts to
do the actual resolution, and it is usually better to use "git add"
on each files after doing the resolution.

On the other hand, using 'git commit -a' is potentially dangerous,
as it makes it very easy to mistakenly commit conflict markers
without noticing, and even worse, the user may have started a merge
while having local changes that do not overlap with it in the
working tree.

While we're there, synchronize the 'git pull' and 'git merge'
messages: the first was ending with '... and make a commit.', but
not the latter.

Eventually, git should detect that conflicts have been resolved in
the working tree and tailor these messages further. Not only "use
git commit -a" could be resurected, but "Fix them up in the work
tree" should be dropped when it happens.

Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

teach fast-export an --anonymize optionJeff King Wed, 27 Aug 2014 17:01:28 +0000 (13:01 -0400)

teach fast-export an --anonymize option

Sometimes users want to report a bug they experience on
their repository, but they are not at liberty to share the
contents of the repository. It would be useful if they could
produce a repository that has a similar shape to its history
and tree, but without leaking any information. This
"anonymized" repository could then be shared with developers
(assuming it still replicates the original problem).

This patch implements an "--anonymize" option to
fast-export, which generates a stream that can recreate such
a repository. Producing a single stream makes it easy for
the caller to verify that they are not leaking any useful
information. You can get an overview of what will be shared
by running a command like:

git fast-export --anonymize --all |
perl -pe 's/\d+/X/g' |
sort -u |
less

which will show every unique line we generate, modulo any
numbers (each anonymized token is assigned a number, like
"User 0", and we replace it consistently in the output).

In addition to anonymizing, this produces test cases that
are relatively small (compared to the original repository)
and fast to generate (compared to using filter-branch, or
modifying the output of fast-export yourself). Here are
numbers for git.git:

$ time git fast-export --anonymize --all \
--tag-of-filtered-object=drop >output
real 0m2.883s
user 0m2.828s
sys 0m0.052s

$ gzip output
$ ls -lh output.gz | awk '{print $5}'
2.9M

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>