git.git
11 years agogit-remote-mediawiki: fix incorrect test usage in test
Matthieu Moy [Tue, 17 Jul 2012 14:05:59 +0000 (16:05 +0200)]
git-remote-mediawiki: fix incorrect test usage in test

Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agogit-remote-mediawiki: properly deal with invalid remote revisions
Matthieu Moy [Mon, 16 Jul 2012 19:46:42 +0000 (21:46 +0200)]
git-remote-mediawiki: properly deal with invalid remote revisions

Some wiki, including https://git.wiki.kernel.org/ have invalid revision
numbers (i.e. the actual revision numbers are non-contiguous). Don't die
when encountering one.

Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agogit-remote-mediawiki: show progress information when getting last remote revision
Matthieu Moy [Mon, 16 Jul 2012 19:46:41 +0000 (21:46 +0200)]
git-remote-mediawiki: show progress information when getting last remote revision

Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agogit-remote-mediawiki: show progress information when listing pages
Matthieu Moy [Mon, 16 Jul 2012 19:46:40 +0000 (21:46 +0200)]
git-remote-mediawiki: show progress information when listing pages

Initial phases of push and pull with git-remote-mediawiki can be long on
a large wiki. Let the user know what's going on.

Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agogit-remote-mediawiki: use --force when adding notes
Matthieu Moy [Mon, 16 Jul 2012 19:46:39 +0000 (21:46 +0200)]
git-remote-mediawiki: use --force when adding notes

When notes are created to record a push, it normally doesn't exist yet.
However, when a push is interrupted and then restarted, it may happen
that a commit already has notes attached, and we want to reflect the newly
created remote revision, hence use 'git notes add -f' to override the
existing one

Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agogit-remote-mediawiki: get rid of O(N^2) loop
Matthieu Moy [Mon, 16 Jul 2012 19:46:38 +0000 (21:46 +0200)]
git-remote-mediawiki: get rid of O(N^2) loop

The algorithm to find a path from the local revision to the remote one
was calling "git rev-list" and parsing its output N times. Run rev-list
only once, and fill a hashtable with the result to optimize the body of
the loop.

Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agogit-remote-mediawiki: make mediafiles export optional
Matthieu Moy [Mon, 16 Jul 2012 19:46:37 +0000 (21:46 +0200)]
git-remote-mediawiki: make mediafiles export optional

It is possible to use git-remote-mediawiki on a tree with both .mw files
and other files. Before git-remote-mediawiki learnt how to export
mediafiles, such mixed trees allowed the user to maintain both the wiki
and other files for the same project in the same repository. With the
newly added support for exporting mediafiles, pushing such mixed trees
would upload unrelated files as mediafiles, which may not be desired.

Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agogit-remote-mediawiki: actually send empty comment when they're empty
Matthieu Moy [Mon, 16 Jul 2012 12:00:47 +0000 (14:00 +0200)]
git-remote-mediawiki: actually send empty comment when they're empty

Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agogit-remote-mediawiki: don't split namespaces with spaces
Matthieu Moy [Mon, 16 Jul 2012 12:00:46 +0000 (14:00 +0200)]
git-remote-mediawiki: don't split namespaces with spaces

Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agoUpdate draft release notes for 7th batch
Junio C Hamano [Mon, 16 Jul 2012 04:46:26 +0000 (21:46 -0700)]
Update draft release notes for 7th batch

Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agoMerge branch 'tg/maint-cache-name-compare'
Junio C Hamano [Mon, 16 Jul 2012 04:40:17 +0000 (21:40 -0700)]
Merge branch 'tg/maint-cache-name-compare'

Even though the index can record pathnames longer than 1<<12 bytes,
in some places we were not comparing them in full, potentially
replacing index entries instead of adding.

* tg/maint-cache-name-compare:
  cache_name_compare(): do not truncate while comparing paths

11 years agoMerge branch 'jk/index-pack-streaming-fix'
Junio C Hamano [Mon, 16 Jul 2012 04:40:07 +0000 (21:40 -0700)]
Merge branch 'jk/index-pack-streaming-fix'

The streaming index-pack introduced in 1.7.11 had a data corruption
bug, and this should fix it.

* jk/index-pack-streaming-fix:
  index-pack: loop while inflating objects in unpack_data

11 years agoMerge branch 'jk/maint-commit-amend-only-no-paths'
Junio C Hamano [Mon, 16 Jul 2012 04:39:48 +0000 (21:39 -0700)]
Merge branch 'jk/maint-commit-amend-only-no-paths'

"git commit --amend --only --" was meant to allow "Clever" people to
rewrite the commit message without making any change even when they
have already changes for the next commit added to their index, but
it never worked as advertised since it was introduced in 1.3.0 era.

* jk/maint-commit-amend-only-no-paths:
  commit: fix "--amend --only" with no pathspec

11 years agoMerge branch 'cw/amend-commit-without-message'
Junio C Hamano [Mon, 16 Jul 2012 04:39:37 +0000 (21:39 -0700)]
Merge branch 'cw/amend-commit-without-message'

"commit --amend" used to refuse amending a commit with an empty log
message, with or without "--allow-empty-message".

* cw/amend-commit-without-message:
  Allow edit of empty message with commit --amend

11 years agoMerge branch 'jn/makefile-cleanup'
Junio C Hamano [Mon, 16 Jul 2012 04:39:17 +0000 (21:39 -0700)]
Merge branch 'jn/makefile-cleanup'

Tightens dependency rules to avoid unnecessary recompilation, and
cleans up our Makefile in general.

* jn/makefile-cleanup:
  Makefile: document ground rules for target-specific dependencies
  Makefile: move GIT-VERSION-FILE dependencies closer to use
  Makefile: build instaweb similar to other scripts
  Makefile: update scripts when build-time parameters change
  Makefile: do not replace @@GIT_VERSION@@ in shell scripts
  Makefile: split prefix flags from GIT-CFLAGS
  Makefile: be silent when only GIT_USER_AGENT changes
  Makefile: split GIT_USER_AGENT from GIT-CFLAGS
  Makefile: do not replace @@GIT_USER_AGENT@@ in scripts
  Makefile: apply dependencies consistently to sparse/asm targets
  Makefile: do not have git.o depend on common-cmds.h
  Makefile: fold XDIFF_H and VCSSVN_H into LIB_H
  Makefile: fold MISC_H into LIB_H
  Makefile: sort LIB_H list

11 years agoMerge branch 'ar/clone-honor-umask-at-top'
Junio C Hamano [Mon, 16 Jul 2012 04:39:03 +0000 (21:39 -0700)]
Merge branch 'ar/clone-honor-umask-at-top'

A handful of files and directories we create had tighter than
necessary permission bits when the user wanted to have group
writability (e.g. by setting "umask 002").

* ar/clone-honor-umask-at-top:
  add: create ADD_EDIT.patch with mode 0666
  rerere: make rr-cache fanout directory honor umask
  Restore umasks influence on the permissions of work tree created by clone

11 years agoMerge branch 'jc/apply-3way'
Junio C Hamano [Mon, 16 Jul 2012 04:38:51 +0000 (21:38 -0700)]
Merge branch 'jc/apply-3way'

"git apply" learned to wiggle the base version and perform three-way
merge when a patch does not exactly apply to the version you have.

* jc/apply-3way:
  apply: tests for the --3way option
  apply: document --3way option
  apply: allow rerere() to work on --3way results
  apply: register conflicted stages to the index
  apply: --3way with add/add conflict
  apply: move verify_index_match() higher
  apply: plug the three-way merge logic in
  apply: fall back on three-way merge
  apply: accept -3/--3way command line option
  apply: move "already exists" logic to check_to_create()
  apply: move check_to_create_blob() closer to its sole caller
  apply: further split load_preimage()
  apply: refactor "previous patch" logic
  apply: split load_preimage() helper function out
  apply: factor out checkout_target() helper function
  apply: refactor read_file_or_gitlink()
  apply: clear_image() clears things a bit more
  apply: a bit more comments on PATH_TO_BE_DELETED
  apply: fix an incomplete comment in check_patch()

11 years agoMerge branch 'cw/rebase-i-root'
Junio C Hamano [Mon, 16 Jul 2012 04:38:41 +0000 (21:38 -0700)]
Merge branch 'cw/rebase-i-root'

"git rebase [-i] --root $tip" can now be used to rewrite all the
history down to the root.

* cw/rebase-i-root:
  t3404: make test 57 work with dash and others
  Add tests for rebase -i --root without --onto
  rebase -i: support --root without --onto

11 years agoMerge branch 'pw/git-p4-move'
Junio C Hamano [Mon, 16 Jul 2012 04:38:32 +0000 (21:38 -0700)]
Merge branch 'pw/git-p4-move'

* pw/git-p4-move:
  git p4: add support for 'p4 move' in P4Submit
  git p4: refactor diffOpts calculation

11 years agoMerge branch 'pw/git-p4-jobs'
Junio C Hamano [Sat, 14 Jul 2012 04:22:12 +0000 (21:22 -0700)]
Merge branch 'pw/git-p4-jobs'

Teach "git p4" to notice "Jobs:" in the log message and relay it to
Perforce to trigger its "jobs" support.

# By Pete Wyckoff
* pw/git-p4-jobs:
  git p4: notice Jobs lines in git commit messages
  git p4 test: refactor marshal_dump
  git p4: remove unused P4Submit interactive setting

11 years agoMerge branch 'jk/push-delete-ref-error-message'
Junio C Hamano [Sat, 14 Jul 2012 04:22:12 +0000 (21:22 -0700)]
Merge branch 'jk/push-delete-ref-error-message'

The error message from "git push $there :bogo" mentioned we tried
and failed to guess what ref is being deleted based on the LHS of
the refspec, which we don't.

# By Jeff King
* jk/push-delete-ref-error-message:
  push: don't guess at qualifying remote refs on deletion

11 years agoSixth batch for 1.7.12
Junio C Hamano [Fri, 13 Jul 2012 22:48:50 +0000 (15:48 -0700)]
Sixth batch for 1.7.12

Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agoMerge branch 'jc/refactor-diff-stdin'
Junio C Hamano [Fri, 13 Jul 2012 22:38:05 +0000 (15:38 -0700)]
Merge branch 'jc/refactor-diff-stdin'

Due to the way "git diff --no-index" is bolted onto by touching the
low level code that is shared with the rest of the "git diff" code,
even though it has to work in a very different way, any comparison
that involves a file "-" at the root level incorrectly tried to read
from the standard input.  This cleans up the no-index codepath
further to remove code that reads from the standard input from the
core side, which is never necessary when git is running its usual
diff operation.

* jc/refactor-diff-stdin:
  diff-index.c: "git diff" has no need to read blob from the standard input
  diff-index.c: unify handling of command line paths
  diff-index.c: do not pretend paths are pathspecs

11 years agoMerge branch 'tg/ce-namelen'
Junio C Hamano [Fri, 13 Jul 2012 22:37:58 +0000 (15:37 -0700)]
Merge branch 'tg/ce-namelen'

Trivially correct clean-up and micro optimization.

* tg/ce-namelen:
  Replace strlen() with ce_namelen()

11 years agoMerge branch 'tb/sanitize-decomposed-utf-8-pathname'
Junio C Hamano [Fri, 13 Jul 2012 22:37:51 +0000 (15:37 -0700)]
Merge branch 'tb/sanitize-decomposed-utf-8-pathname'

Teaches git to normalize pathnames read from readdir(3) and all
arguments from the command line into precomposed UTF-8 (assuming
that they come as decomposed UTF-8) to work around issues on Mac OS.

I think there still are other places that need conversion
(e.g. paths that are read from stdin for some commands), but this
should be a good first step in the right direction.

* tb/sanitize-decomposed-utf-8-pathname:
  git on Mac OS and precomposed unicode

11 years agoMerge branch 'mm/mediawiki-tests'
Junio C Hamano [Fri, 13 Jul 2012 22:37:46 +0000 (15:37 -0700)]
Merge branch 'mm/mediawiki-tests'

* mm/mediawiki-tests:
  git-remote-mediawiki: be more defensive when requests fail
  git-remote-mediawiki: more efficient 'pull' in the best case
  git-remote-mediawiki: extract revision-importing loop to a function
  git-remote-mediawiki: refactor loop over revision ids
  git-remote-mediawiki: change return type of get_mw_pages
  git-remote-mediawiki (t9363): test 'File:' import and export
  git-remote-mediawiki: support for uploading file in test environment
  git-remote-mediawiki (t9362): test git-remote-mediawiki with UTF8 characters
  git-remote-mediawiki (t9361): test git-remote-mediawiki pull and push
  git-remote-mediawiki (t9360): test git-remote-mediawiki clone
  git-remote-mediawiki: test environment of git-remote-mediawiki
  git-remote-mediawiki: scripts to install, delete and clear a MediaWiki

11 years agoMerge branch 'jn/vcs-svn'
Junio C Hamano [Fri, 13 Jul 2012 22:37:04 +0000 (15:37 -0700)]
Merge branch 'jn/vcs-svn'

vcs-svn updates to clean-up compilation, lift 32-bit limitations, etc.

* jn/vcs-svn:
  vcs-svn: allow 64-bit Prop-Content-Length
  vcs-svn: suppress a signed/unsigned comparison warning
  vcs-svn: suppress a signed/unsigned comparison warning
  vcs-svn: suppress signed/unsigned comparison warnings
  vcs-svn: use strstr instead of memmem
  vcs-svn: use constcmp instead of prefixcmp
  vcs-svn: simplify cleanup in apply_one_window
  vcs-svn: avoid self-assignment in dummy initialization of pre_off
  vcs-svn: drop no-op reset methods
  vcs-svn: suppress -Wtype-limits warning
  vcs-svn: allow import of > 4GiB files
  vcs-svn: rename check_overflow and its arguments for clarity

11 years agoMerge branch 'mm/mediawiki-file-attachments'
Junio C Hamano [Fri, 13 Jul 2012 22:36:53 +0000 (15:36 -0700)]
Merge branch 'mm/mediawiki-file-attachments'

"mediawiki" remote helper (in contrib/) learned to handle file
attachments.

* mm/mediawiki-file-attachments:
  git-remote-mediawiki: improve support for non-English Wikis
  git-remote-mediawiki: import "File:" attachments
  git-remote-mediawiki: split get_mw_pages into smaller functions
  git-remote-mediawiki: send "File:" attachments to a remote wiki
  git-remote-mediawiki: don't "use encoding 'utf8';"
  git-remote-mediawiki: don't compute the diff when getting commit message

11 years agoMerge branch 'tr/maint-show-walk'
Junio C Hamano [Fri, 13 Jul 2012 22:36:44 +0000 (15:36 -0700)]
Merge branch 'tr/maint-show-walk'

Fixes "git show"'s auto-walking behaviour, and make it behave just
like "git log" does when it walks.

* tr/maint-show-walk:
  show: fix "range implies walking"
  Demonstrate git-show is broken with ranges

11 years agoMerge branch 'mz/rebase-no-mbox'
Junio C Hamano [Fri, 13 Jul 2012 22:36:31 +0000 (15:36 -0700)]
Merge branch 'mz/rebase-no-mbox'

Teach "am --rebasing" codepath to grab authorship, log message and
the patch text directly out of existing commits.  This will help
rebasing commits that have confusing "diff" output in their log
messages.

* mz/rebase-no-mbox:
  am: don't call mailinfo if $rebasing
  am --rebasing: get patch body from commit, not from mailbox
  rebase --root: print usage on too many args
  rebase: don't source git-sh-setup twice

11 years agogit p4: add support for 'p4 move' in P4Submit
Gary Gibbons [Thu, 12 Jul 2012 23:29:00 +0000 (19:29 -0400)]
git p4: add support for 'p4 move' in P4Submit

For -M option (detectRenames) in P4Submit, use 'p4 move' rather
than 'p4 integrate'.  Check Perforce server for exisitence of
'p4 move' and use it if present, otherwise revert to 'p4 integrate'.

[pw: wildcard-encode src/dest, add/update tests, tweak code]

Signed-off-by: Gary Gibbons <ggibbons@perforce.com>
Signed-off-by: Pete Wyckoff <pw@padd.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agoReduce draft release notes to 1.7.12
Junio C Hamano [Wed, 11 Jul 2012 20:48:57 +0000 (13:48 -0700)]
Reduce draft release notes to 1.7.12

Many "fixes since 1.7.11" items are now in the maintenance track

Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agoSync with 1.7.11.2
Junio C Hamano [Wed, 11 Jul 2012 20:00:51 +0000 (13:00 -0700)]
Sync with 1.7.11.2

11 years agoGit 1.7.11.2 v1.7.11.2
Junio C Hamano [Wed, 11 Jul 2012 19:55:38 +0000 (12:55 -0700)]
Git 1.7.11.2

Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agoMerge branch 'jc/maint-blame-unique-abbrev' into maint
Junio C Hamano [Wed, 11 Jul 2012 19:58:28 +0000 (12:58 -0700)]
Merge branch 'jc/maint-blame-unique-abbrev' into maint

"git blame" did not try to make sure that the abbreviated commit
object names in its output are unique.

* jc/maint-blame-unique-abbrev:
  blame: compute abbreviation width that ensures uniqueness

11 years agoMerge branch 'rj/platform-pread-may-be-thread-unsafe' into maint
Junio C Hamano [Wed, 11 Jul 2012 19:57:28 +0000 (12:57 -0700)]
Merge branch 'rj/platform-pread-may-be-thread-unsafe' into maint

On Cygwin, the platform pread(2) is not thread safe, just like our own
compat/ emulation, and cannot be used in the index-pack program.
Makefile variable NO_THREAD_SAFE_PREAD can be defined to avoid use of
this function in a threaded program.

* rj/platform-pread-may-be-thread-unsafe:
  index-pack: Disable threading on cygwin

11 years agoMerge branch 'th/diff-no-index-fixes' into maint
Junio C Hamano [Wed, 11 Jul 2012 19:48:44 +0000 (12:48 -0700)]
Merge branch 'th/diff-no-index-fixes' into maint

"git diff --no-index" did not correctly handle relative paths and
did not correctly give exit codes when run under "--quiet" option.

* th/diff-no-index-fixes:
  diff-no-index: exit(1) if 'diff --quiet <repo file> <external file>' finds changes
  diff: handle relative paths in no-index

11 years agoMerge branch 'nd/clone-single-fix' into maint
Junio C Hamano [Wed, 11 Jul 2012 19:48:29 +0000 (12:48 -0700)]
Merge branch 'nd/clone-single-fix' into maint

"git clone --single-branch" to clone a single branch did not limit
the cloning to the specified branch.

* nd/clone-single-fix:
  clone: fix ref selection in --single-branch --branch=xxx

11 years agoMerge branch 'jc/rev-list-simplify-merges-first-parent' into maint
Junio C Hamano [Wed, 11 Jul 2012 19:46:57 +0000 (12:46 -0700)]
Merge branch 'jc/rev-list-simplify-merges-first-parent' into maint

When "git log" gets "--simplify-merges/by-decoration" together with
"--first-parent", the combination of these options makes the
simplification logic to use in-core commit objects that haven't been
examined for relevance, either producing incorrect result or taking
too long to produce any output.  Teach the simplification logic to
ignore commits that the first-parent traversal logic ignored when
both are in effect to work around the issue.

* jc/rev-list-simplify-merges-first-parent:
  revision: ignore side parents while running simplify-merges
  revision: note the lack of free() in simplify_merges()
  revision: "simplify" options imply topo-order sort

11 years agoMerge branch 'hv/submodule-update-nuke-submodules' into maint
Junio C Hamano [Wed, 11 Jul 2012 19:46:31 +0000 (12:46 -0700)]
Merge branch 'hv/submodule-update-nuke-submodules' into maint

"git add" allows adding a regular file to the path where a submodule
used to exist, but "git update-index" did not allow an equivalent
operation to Porcelain writers.

* hv/submodule-update-nuke-submodules:
  update-index: allow overwriting existing submodule index entries

11 years agoMerge branch 'jk/diff-no-index-pager' into maint
Junio C Hamano [Wed, 11 Jul 2012 19:46:21 +0000 (12:46 -0700)]
Merge branch 'jk/diff-no-index-pager' into maint

"git diff --no-index" did not work with pagers correctly.

* jk/diff-no-index-pager:
  do not run pager with diff --no-index --quiet
  fix pager.diff with diff --no-index

11 years agoMerge branch 'mm/verify-filename-fix' into maint
Junio C Hamano [Wed, 11 Jul 2012 19:45:49 +0000 (12:45 -0700)]
Merge branch 'mm/verify-filename-fix' into maint

"git diff COPYING HEAD:COPYING" gave a nonsense error message that
claimed that the treeish HEAD did not have COPYING in it.

* mm/verify-filename-fix:
  verify_filename(): ask the caller to chose the kind of diagnosis
  sha1_name: do not trigger detailed diagnosis for file arguments

11 years agoMerge branch 'cn/cherry-pick-range-docs' into maint
Junio C Hamano [Wed, 11 Jul 2012 19:45:34 +0000 (12:45 -0700)]
Merge branch 'cn/cherry-pick-range-docs' into maint

The documentation for "git cherry-pick A B..C" was misleading.

* cn/cherry-pick-range-docs:
  git-cherry-pick.txt: clarify the use of revision range notation
  Documentation: --no-walk is no-op if range is specified

11 years agoMerge branch 'jc/ustar-checksum-is-unsigned' into maint
Junio C Hamano [Wed, 11 Jul 2012 19:45:07 +0000 (12:45 -0700)]
Merge branch 'jc/ustar-checksum-is-unsigned' into maint

"git archive" incorrectly computed the header checksum; the symptom
was observed only when using pathnames with hi-bit set.

* jc/ustar-checksum-is-unsigned:
  archive: ustar header checksum is computed unsigned

11 years agoMerge branch 'jc/bundle-complete-notice' into maint
Junio C Hamano [Wed, 11 Jul 2012 19:44:50 +0000 (12:44 -0700)]
Merge branch 'jc/bundle-complete-notice' into maint

Running "git bundle verify" on a bundle that records a complete
history said "it requires these 0 commits".

* jc/bundle-complete-notice:
  tweak "bundle verify" of a complete history

11 years agoMerge branch 'jc/ls-files-i-dir' into maint
Junio C Hamano [Wed, 11 Jul 2012 19:44:34 +0000 (12:44 -0700)]
Merge branch 'jc/ls-files-i-dir' into maint

"git ls-files --exclude=t -i" did not consider anything under t/ as
excluded, as it did not pay attention to exclusion of leading paths
while walking the index.  Other two users of excluded() are also
updated.

* jc/ls-files-i-dir:
  dir.c: make excluded() file scope static
  unpack-trees.c: use path_excluded() in check_ok_to_remove()
  builtin/add.c: use path_excluded()
  path_excluded(): update API to less cache-entry centric
  ls-files -i: micro-optimize path_excluded()
  ls-files -i: pay attention to exclusion of leading paths

11 years agoMerge branch 'jc/request-pull-match-tagname' into maint
Junio C Hamano [Wed, 11 Jul 2012 19:43:58 +0000 (12:43 -0700)]
Merge branch 'jc/request-pull-match-tagname' into maint

"git request-pull $url dev" when the tip of "dev" branch was tagged
with "ext4-for-linus" used the contents from the tag in the output
but still asked the "dev" branch to be pulled, not the tag.

* jc/request-pull-match-tagname:
  request-pull: really favor a matching tag

11 years agocache_name_compare(): do not truncate while comparing paths
Junio C Hamano [Wed, 11 Jul 2012 16:08:28 +0000 (09:08 -0700)]
cache_name_compare(): do not truncate while comparing paths

We failed to use ce_namelen() equivalent and instead only compared
up to the CE_NAMEMASK bytes by mistake.  Adding an overlong path
that shares the same common prefix as an existing entry in the index
did not add a new entry, but instead replaced the existing one, as
the result.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agoindex-pack: loop while inflating objects in unpack_data
Jeff King [Wed, 4 Jul 2012 07:12:14 +0000 (03:12 -0400)]
index-pack: loop while inflating objects in unpack_data

When the unpack_data function is given a consume() callback,
it unpacks only 64K of the input at a time, feeding it to
git_inflate along with a 64K output buffer.  However,
because we are inflating, there is a good chance that the
output buffer will fill before consuming all of the input.
In this case, we need to loop on git_inflate until we have
fed the whole input buffer, feeding each chunk of output to
the consume buffer.

The current code does not do this, and as a result, will
fail the loop condition and trigger a fatal "serious inflate
inconsistency" error in this case.

While we're rearranging the loop, let's get rid of the
extra last_out pointer. It is meant to point to the
beginning of the buffer that we feed to git_inflate, but in
practice this is always the beginning of our same 64K
buffer, because:

  1. At the beginning of the loop, we are feeding the
     buffer.

  2. At the end of the loop, if we are using a consume()
     function, we reset git_inflate's pointer to the
     beginning of the buffer.  If we are not using a
     consume() function, then we do not care about the value
     of last_out at all.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agocommit: fix "--amend --only" with no pathspec
Jeff King [Tue, 10 Jul 2012 20:40:29 +0000 (16:40 -0400)]
commit: fix "--amend --only" with no pathspec

When we do not have any pathspec, we typically disallow an
explicit "--only", because it makes no sense (your commit
would, by definition, be empty). But since 6a74642
(git-commit --amend: two fixes., 2006-04-20), we have
allowed "--amend --only" with the intent that it would amend
the commit, ignoring any contents staged in the index.

However, while that commit allowed the combination, we never
actually implemented the logic to make it work. The current
code notices that we have no pathspec and assumes we want to
do an as-is commit (i.e., the "--only" is ignored).

Instead, we must make sure to follow the partial-commit
code-path. We also need to tweak the list_paths function to
handle a NULL pathspec.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agoapply: tests for the --3way option
Junio C Hamano [Wed, 13 Jun 2012 05:57:57 +0000 (22:57 -0700)]
apply: tests for the --3way option

Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agoadd: create ADD_EDIT.patch with mode 0666
Jeff King [Tue, 10 Jul 2012 06:37:22 +0000 (02:37 -0400)]
add: create ADD_EDIT.patch with mode 0666

We should be letting the user's umask take care of
restricting permissions. Even though this is a temporary
file and probably nobody would notice, this brings us in
line with other temporary file creations in git (e.g.,
choosing "e"dit from git-add--interactive).

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agorerere: make rr-cache fanout directory honor umask
Junio C Hamano [Mon, 9 Jul 2012 23:27:49 +0000 (16:27 -0700)]
rerere: make rr-cache fanout directory honor umask

This is the last remaining call to mkdir(2) that restricts the permission
bits by passing 0755.  Just use the same mkdir_in_gitdir() used to create
the leaf directories.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agoapply: document --3way option
Junio C Hamano [Thu, 10 May 2012 21:08:29 +0000 (14:08 -0700)]
apply: document --3way option

Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agoapply: allow rerere() to work on --3way results
Junio C Hamano [Thu, 10 May 2012 20:56:49 +0000 (13:56 -0700)]
apply: allow rerere() to work on --3way results

Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agoapply: register conflicted stages to the index
Junio C Hamano [Wed, 9 May 2012 23:50:58 +0000 (16:50 -0700)]
apply: register conflicted stages to the index

Now we have all the necessary logic to fall back on three-way merge when
the patch does not cleanly apply, insert the conflicted entries to the
index as appropriate.  This obviously triggers only when the "--index"
option is used.

When we fall back to three-way merge and some of the merges fail, just
like the case where the "--reject" option was specified and we had to
write some "*.rej" files out for unapplicable patches, exit the command
with non-zero status without showing the diffstat and summary.  Otherwise
they would make the list of problematic paths scroll off the display.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agoapply: --3way with add/add conflict
Junio C Hamano [Thu, 7 Jun 2012 22:04:11 +0000 (15:04 -0700)]
apply: --3way with add/add conflict

When a patch wants to create a path, but we already have it in our
current state, pretend as if the patch and we independently added
the same path and cause add/add conflict, so that the user can
resolve it just like "git merge" in the same situation.

For that purpose, implement load_current() in terms of the
load_patch_target() helper introduced earlier to read the current
contents from the path given by patch->new_name (patch->old_name is
NULL for a creation patch).

Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agoapply: move verify_index_match() higher
Junio C Hamano [Wed, 13 Jun 2012 04:16:02 +0000 (21:16 -0700)]
apply: move verify_index_match() higher

We will be adding another caller of this function in a later patch.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agoapply: plug the three-way merge logic in
Junio C Hamano [Wed, 9 May 2012 23:10:51 +0000 (16:10 -0700)]
apply: plug the three-way merge logic in

When a patch does not apply to what we have, but we know the preimage the
patch was made against, we apply the patch to the preimage to compute what
the patch author wanted the result to look like, and attempt a three-way
merge between the result and our version, using the intended preimage as
the base version.

When we are applying the patch using the index, we would additionally need
to add the object names of these three blobs involved in the merge, which
is not yet done in this step, but we add a field to "struct patch" so that
later write-out step can use it.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agoapply: fall back on three-way merge
Junio C Hamano [Fri, 8 Jun 2012 16:54:10 +0000 (09:54 -0700)]
apply: fall back on three-way merge

Grab the preimage blob the patch claims to be based on out of the object
store, apply the patch, and then call three-way-merge function.  This step
still does not plug the actual three-way merge logic yet, but we are
getting there.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agoapply: accept -3/--3way command line option
Junio C Hamano [Tue, 8 May 2012 20:21:53 +0000 (13:21 -0700)]
apply: accept -3/--3way command line option

Begin teaching the three-way merge fallback logic "git am -3" uses
to the underlying "git apply".  It only implements the command line
parsing part, and does not do anything interesting yet, other than
making sure that "--reject" and "--3way" are not given together, and
making "--3way" imply "--index".

Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agoapply: move "already exists" logic to check_to_create()
Junio C Hamano [Thu, 7 Jun 2012 21:10:19 +0000 (14:10 -0700)]
apply: move "already exists" logic to check_to_create()

The check_to_create_blob() function used to check only the case
where we are applying to the working tree.  Rename the function to
check_to_create() and make it also responsible for checking the case
where we apply to the index.  Also make its caller responsible for
issuing an error message.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agoapply: move check_to_create_blob() closer to its sole caller
Junio C Hamano [Thu, 7 Jun 2012 21:06:47 +0000 (14:06 -0700)]
apply: move check_to_create_blob() closer to its sole caller

Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agoapply: further split load_preimage()
Junio C Hamano [Tue, 12 Jun 2012 22:23:54 +0000 (15:23 -0700)]
apply: further split load_preimage()

load_preimage() is very specific to grab the current contents for
the path given by patch->old_name.  Split the logic that grabs the
contents for a path out of it into a separate load_patch_target()
function.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agoapply: refactor "previous patch" logic
Junio C Hamano [Wed, 16 May 2012 21:03:52 +0000 (14:03 -0700)]
apply: refactor "previous patch" logic

The code to grab the result of application of a previous patch in the
input was mixed with error message generation for a case where a later
patch tries to modify contents of a path that has been removed.

The same code is duplicated elsewhere in the code.  Introduce a helper
to clarify what is going on.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agoapply: split load_preimage() helper function out
Junio C Hamano [Tue, 8 May 2012 20:35:21 +0000 (13:35 -0700)]
apply: split load_preimage() helper function out

Given a patch for a single path, the function apply_data() reads the
preimage in core, and applies the change represented in the patch.

Separate out the first part that reads the preimage into a separate
helper function load_preimage().

Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agoapply: factor out checkout_target() helper function
Junio C Hamano [Wed, 13 Jun 2012 05:47:12 +0000 (22:47 -0700)]
apply: factor out checkout_target() helper function

When a patch wants to touch a path, if the path exists in the index
but is missing in the working tree, "git apply --index" checks out
the file to the working tree from the index automatically and then
applies the patch.

Split this logic out to a separate helper function.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agoapply: refactor read_file_or_gitlink()
Junio C Hamano [Tue, 8 May 2012 22:11:02 +0000 (15:11 -0700)]
apply: refactor read_file_or_gitlink()

Reading a blob out of the object store does not have to require that the
caller has a cache entry for it.

Create a read_blob_object() helper function that takes the object name and
mode, and use it to reimplement the original function as a thin wrapper to
it.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agoapply: clear_image() clears things a bit more
Junio C Hamano [Tue, 8 May 2012 21:38:06 +0000 (14:38 -0700)]
apply: clear_image() clears things a bit more

The clear_image() function did not clear the line table in the image
structure; this does not matter for the current callers, as the function
is only called from the codepaths that deal with binary patches where the
line table is never populated, and the codepaths that do populate the line
table free it themselves.

But it will start to matter when we introduce a codepath to retry a failed
patch, so make sure it clears and frees everything.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agoapply: a bit more comments on PATH_TO_BE_DELETED
Junio C Hamano [Wed, 16 May 2012 20:21:39 +0000 (13:21 -0700)]
apply: a bit more comments on PATH_TO_BE_DELETED

The code is littered with to_be_deleted() whose purpose is not so clear.
Describe where it matters.  Also remove an extra space before "#define"
that snuck in by mistake at 7fac0ee (builtin-apply: keep information about
files to be deleted, 2009-04-11).

Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agoapply: fix an incomplete comment in check_patch()
Junio C Hamano [Wed, 16 May 2012 22:31:18 +0000 (15:31 -0700)]
apply: fix an incomplete comment in check_patch()

This check is not only about type-change (for which it would be
sufficient to check only was_deleted()) but is also about a swap
rename.  Otherwise to_be_deleted() check is not justified.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agoRestore umasks influence on the permissions of work tree created by clone
Alex Riesen [Sat, 7 Jul 2012 21:50:30 +0000 (23:50 +0200)]
Restore umasks influence on the permissions of work tree created by clone

The original version of the git-clone just used mkdir(1) to create
the working directories.  The version rewritten in C creates all
directories inside the working tree by using the mode argument of
0777 when calling mkdir(2) to let the umask take effect.

But the top-level directory of the working tree is created by
passing the mode argument of 0755 to mkdir(2), which results in an
overly tight restriction if the user wants to make directories group
writable with a looser umask like 002.

Signed-off-by: Alex Riesen <raa.lkml@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agoAllow edit of empty message with commit --amend
Chris Webb [Mon, 9 Jul 2012 18:53:26 +0000 (19:53 +0100)]
Allow edit of empty message with commit --amend

"git commit --amend" used on a commit with an empty message fails
unless -m is given, whether or not --allow-empty-message is
specified.

Allow it to proceed to the editor with an empty commit message.
Unless --allow-empty-message is in force, it will still abort later
if an empty message is saved from the editor (this check was
already necessary to prevent a non-empty commit message being edited
to an empty one).

Add a test for --amend --edit of an empty commit message which fails
without this fix, as it's a rare case that won't get frequently
tested otherwise.

Signed-off-by: Chris Webb <chris@arachsys.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agoMerge git://github.com/git-l10n/git-po
Junio C Hamano [Mon, 9 Jul 2012 17:26:23 +0000 (10:26 -0700)]
Merge git://github.com/git-l10n/git-po

Translation updates for various languages.

* git://github.com/git-l10n/git-po:
  l10n: zh_CN.po: translate 29 new messages
  l10n: de.po: translate 29 new messages
  Update Swedish translation (1095t0f0u)
  l10n: Update translation for Vietnamese
  l10n: Update git.pot (29 new messages)

11 years agoFifth batch for 1.7.12
Junio C Hamano [Mon, 9 Jul 2012 16:49:37 +0000 (09:49 -0700)]
Fifth batch for 1.7.12

Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agoMerge branch 'cw/help-over-network'
Junio C Hamano [Mon, 9 Jul 2012 16:02:19 +0000 (09:02 -0700)]
Merge branch 'cw/help-over-network'

"git help -w $cmd" can show HTML version of documentation for
"git-$cmd" by setting help.htmlpath to somewhere other than the
default location where the build procedure installs them locally;
the variable can even point at a http:// URL.

* cw/help-over-network:
  Allow help.htmlpath to be a URL prefix
  Add config variable to set HTML path for git-help --web

11 years agoMerge branch 'mz/empty-rebase-test'
Junio C Hamano [Mon, 9 Jul 2012 16:02:15 +0000 (09:02 -0700)]
Merge branch 'mz/empty-rebase-test'

We did not have test to make sure "git rebase" without extra options
filters out an empty commit in the original history.

* mz/empty-rebase-test:
  add test case for rebase of empty commit

11 years agoMerge branch 'pw/git-p4-tests'
Junio C Hamano [Mon, 9 Jul 2012 16:02:11 +0000 (09:02 -0700)]
Merge branch 'pw/git-p4-tests'

More "git p4" tests.

* pw/git-p4-tests:
  git p4 test: fix badp4dir test
  git p4 test: split up big t9800 test
  git p4 test: cleanup_git should make a new $git
  git p4 test: copy source indeterminate
  git p4 test: check for error message in failed test
  git p4 test: rename some "git-p4 command" strings
  git p4 test: never create default test repo
  git p4 test: simplify quoting involving TRASH_DIRECTORY
  git p4 test: use real_path to resolve p4 client symlinks
  git p4 test: wait longer for p4d to start and test its pid

11 years agoMerge branch 'js/fast-export-paths-with-spaces'
Junio C Hamano [Mon, 9 Jul 2012 16:02:06 +0000 (09:02 -0700)]
Merge branch 'js/fast-export-paths-with-spaces'

"git fast-export" produced an input stream for fast-import without
properly quoting pathnames when they contain SPs in them.

* js/fast-export-paths-with-spaces:
  fast-export: quote paths with spaces

11 years agoMerge branch 'cw/no-detaching-an-unborn'
Junio C Hamano [Mon, 9 Jul 2012 16:02:00 +0000 (09:02 -0700)]
Merge branch 'cw/no-detaching-an-unborn'

"git checkout --detach", when you are still on an unborn branch,
should be forbidden, but it wasn't.

* cw/no-detaching-an-unborn:
  git-checkout: disallow --detach on unborn branch

11 years agoMerge branch 'vr/use-our-perl-in-tests'
Junio C Hamano [Mon, 9 Jul 2012 16:01:52 +0000 (09:01 -0700)]
Merge branch 'vr/use-our-perl-in-tests'

Some implementations of Perl terminates "lines" with CRLF even when
the script is operating on just a sequence of bytes.  Make sure to
use "$PERL_PATH", the version of Perl the user told Git to use, in
our tests to avoid unnecessary breakages in tests.

* vr/use-our-perl-in-tests:
  t/README: add a bit more Don'ts
  tests: enclose $PERL_PATH in double quotes
  t/test-lib.sh: export PERL_PATH for use in scripts
  t: Replace 'perl' by $PERL_PATH

11 years agoMerge branch 'mm/credential-plumbing'
Junio C Hamano [Mon, 9 Jul 2012 16:01:45 +0000 (09:01 -0700)]
Merge branch 'mm/credential-plumbing'

Expose the credential API to scripted Porcelain writers.

* mm/credential-plumbing:
  git-remote-mediawiki: update comments to reflect credential support
  git-remote-mediawiki: add credential support
  git credential fill: output the whole 'struct credential'
  add 'git credential' plumbing command

11 years agoMerge branch 'jc/maint-blame-unique-abbrev'
Junio C Hamano [Mon, 9 Jul 2012 16:01:37 +0000 (09:01 -0700)]
Merge branch 'jc/maint-blame-unique-abbrev'

"git blame" did not try to make sure the abbreviated commit object
names in its output are unique.

* jc/maint-blame-unique-abbrev:
  blame: compute abbreviation width that ensures uniqueness

11 years agoMerge branch 'jn/perl-makemaker-leading-paths'
Junio C Hamano [Mon, 9 Jul 2012 16:00:53 +0000 (09:00 -0700)]
Merge branch 'jn/perl-makemaker-leading-paths'

* jn/perl-makemaker-leading-paths:
  perl/Makefile: Fix a missing double-quote
  perl/Makefile: move "mkdir -p" to module installation loop for maintainability

11 years agoMerge branch 'rj/platform-pread-may-be-thread-unsafe'
Junio C Hamano [Mon, 9 Jul 2012 16:00:45 +0000 (09:00 -0700)]
Merge branch 'rj/platform-pread-may-be-thread-unsafe'

On Cygwin, the platform pread(3) is not thread safe, just like our
own compat/ emulation, and cannot be used in the index-pack program.

* rj/platform-pread-may-be-thread-unsafe:
  index-pack: Disable threading on cygwin

11 years agoMerge branch 'mm/config-xdg'
Junio C Hamano [Mon, 9 Jul 2012 16:00:35 +0000 (09:00 -0700)]
Merge branch 'mm/config-xdg'

Teach git to read various information from $XDG_CONFIG_HOME/git/ to allow
the user to avoid cluttering $HOME.

* mm/config-xdg:
  config: write to $XDG_CONFIG_HOME/git/config file when appropriate
  Let core.attributesfile default to $XDG_CONFIG_HOME/git/attributes
  Let core.excludesfile default to $XDG_CONFIG_HOME/git/ignore
  config: read (but not write) from $XDG_CONFIG_HOME/git/config file

11 years agoMakefile: document ground rules for target-specific dependencies
Jonathan Nieder [Sat, 7 Jul 2012 04:19:09 +0000 (23:19 -0500)]
Makefile: document ground rules for target-specific dependencies

When a source file makes use of a makefile variable, there should be a
corresponding dependency on a file that changes when that variable
changes to ensure the build output is not left stale when the variable
changes.

Document this, even though we are not following the rule perfectly
yet.  Based on an explanation from Jeff King.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agoMakefile: move GIT-VERSION-FILE dependencies closer to use
Jeff King [Wed, 20 Jun 2012 18:32:22 +0000 (14:32 -0400)]
Makefile: move GIT-VERSION-FILE dependencies closer to use

There is a list of all of the targets which depend on
GIT-VERSION-FILE, but it can be quite far from the actual
point where the targets actually use $(GIT_VERSION). This
can make it hard to verify that each use of $(GIT_VERSION)
has a matching dependency.

This patch moves the dependency closer to the actual build
instructions, which makes verification easier.  This also
fixes the generation of "configure", which did not properly
mark the dependency.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agoMakefile: build instaweb similar to other scripts
Jeff King [Wed, 20 Jun 2012 18:32:19 +0000 (14:32 -0400)]
Makefile: build instaweb similar to other scripts

Instaweb would not properly rebuild if the build-time
parameters changed. Fix this by depending on the
GIT-SCRIPT-DEFINES meta-file and using $(cmd_munge_script)
like all the other shell scripts. This requires adding a few
new parametres to cmd_munge_script, but that doesn't hurt
existing scripts.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agoMakefile: update scripts when build-time parameters change
Jeff King [Wed, 20 Jun 2012 18:32:16 +0000 (14:32 -0400)]
Makefile: update scripts when build-time parameters change

Currently, running:

  make SHELL_PATH=/bin/bash &&
  make SHELL_PATH=/bin/sh

will not rebuild any shell scripts in the second command,
leading to incorrect results when building from an unclean
working directory.

This patch introduces a new dependency meta-file to notice
the change.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agoMakefile: do not replace @@GIT_VERSION@@ in shell scripts
Jeff King [Wed, 20 Jun 2012 18:32:10 +0000 (14:32 -0400)]
Makefile: do not replace @@GIT_VERSION@@ in shell scripts

No shell script actually uses the replacement (it is used in
some perl scripts, but cmd_munge_script only handles shell
scripts). We can also therefore drop the dependency on
GIT-VERSION-FILE.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agoMakefile: split prefix flags from GIT-CFLAGS
Jeff King [Wed, 20 Jun 2012 18:31:55 +0000 (14:31 -0400)]
Makefile: split prefix flags from GIT-CFLAGS

Most of the build targets do not care about the setting of
$prefix (or its derivative variables), but will be rebuilt
if the prefix changes. For most setups this doesn't matter
(they set prefix once and never change it), but for a setup
which puts each branch or version in its own prefix, this
unnecessarily causes a full rebuild whenever the branc is
changed.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agoMakefile: be silent when only GIT_USER_AGENT changes
Jonathan Nieder [Sat, 7 Jul 2012 04:42:11 +0000 (23:42 -0500)]
Makefile: be silent when only GIT_USER_AGENT changes

To avoid noise during builds, unlike the GIT-CFLAGS rule which prints
"* new build flags or prefix" so the operator knows why all files are
being rebuilt when it changes, GIT-USER-AGENT generation is silent.

If this code breaks and a target depending on GIT-USER-AGENT ends up
being rebuilt when it shouldn't be, the full dependency chain can be
retrieved with "make --debug=b".

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agoMakefile: split GIT_USER_AGENT from GIT-CFLAGS
Jeff King [Wed, 20 Jun 2012 18:31:51 +0000 (14:31 -0400)]
Makefile: split GIT_USER_AGENT from GIT-CFLAGS

The default user-agent depends on the GIT_VERSION, which
means that anytime you switch versions, it causes a full
rebuild. Instead, let's split it out into its own file and
restrict the dependency to version.o.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agoMakefile: do not replace @@GIT_USER_AGENT@@ in scripts
Jeff King [Wed, 20 Jun 2012 18:31:42 +0000 (14:31 -0400)]
Makefile: do not replace @@GIT_USER_AGENT@@ in scripts

No scripts actually care about this replacement. This was
erroneously added by 42dcbb7 (version: add git_user_agent function,
2012-06-02).

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agoMakefile: apply dependencies consistently to sparse/asm targets
Jeff King [Wed, 20 Jun 2012 18:31:33 +0000 (14:31 -0400)]
Makefile: apply dependencies consistently to sparse/asm targets

When a C file "foo.c" depends on a generated header file, we
note the dependency for the "foo.o" target. However, we
should also note it for other targets that are built from
foo.c, like "foo.sp" and "foo.s". These tend to be missed
because the latter two are not part of the default build,
and are typically built after a regular build which will
generate the header.  Let's be consistent about including
them in dependencies.

This also makes us more consistent with nearby lines which
tack on EXTRA_CPPFLAGS when building certain files.  These
flags may sometimes require extra dependencies to be added
(e.g., like GIT-VERSION-FILE; this is not the case for any
of the updated lines in this patch, but it is establishing a
style that will be used in later patches). Technically the
".sp" and ".s" targets do not care about these dependencies,
because they are force-built (".sp" because it is a phony
target, and ".s" because we explicitly force a rebuild).

Since the blocks in question are about communicating "things
built from foo.c depend on these flags", it frees the reader
from having to know or care more about how those targets are
implemented, and why it is OK for only "foo.o" to depend on
GIT-VERSION-FILE while "foo.sp" and "foo.s" both are
impacted by $(GIT_VERSION). And it helps future-proof us if
those force-build details should ever change.

This patch explicitly does not update the static header
dependencies used when COMPUTED_HEADER_DEPENDENCIES is off.
They are similar to the GIT-VERSION-FILE case above, in that
technically "foo.s" would depend on its included headers,
but it is irrelevant because we force-build it anyway. So it
would be tempting to update them in the same way (for
readability and future-proofing). However, those rules are
meant as a fallback to the computed header dependencies,
which do not handle ".s" and ".sp" at all (and are a much
harder problem to solve, as gcc is the one generating those
dependency lists).

So let's leave that harder problem until (and if) somebody
wants to change the ".sp" and ".s" rules, and keep the
static header dependencies consistent with the computed
ones.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agoMakefile: do not have git.o depend on common-cmds.h
Jeff King [Wed, 20 Jun 2012 18:31:18 +0000 (14:31 -0400)]
Makefile: do not have git.o depend on common-cmds.h

This dependency has been stale since 70827b1 (Split up
builtin commands into separate files from git.c, 2006-04-21).

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agoMakefile: fold XDIFF_H and VCSSVN_H into LIB_H
Jonathan Nieder [Sat, 7 Jul 2012 03:39:18 +0000 (22:39 -0500)]
Makefile: fold XDIFF_H and VCSSVN_H into LIB_H

Just like MISC_H (see previous commit), there is no reason to track
xdiff and vcs-svn headers separately from the rest of the headers.
The only purpose of these variables is to keep track of recompilation
dependencies.

As a pleasant side effect, folding these into LIB_H lets us stop
tracking GIT_OBJS and VCSSVN_TEST_OBJS separately from the list of all
OBJECTS.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agogit on Mac OS and precomposed unicode
Torsten Bögershausen [Sun, 8 Jul 2012 13:50:25 +0000 (15:50 +0200)]
git on Mac OS and precomposed unicode

Mac OS X mangles file names containing unicode on file systems HFS+,
VFAT or SAMBA.  When a file using unicode code points outside ASCII
is created on a HFS+ drive, the file name is converted into
decomposed unicode and written to disk. No conversion is done if
the file name is already decomposed unicode.

Calling open("\xc3\x84", ...) with a precomposed "Ä" yields the same
result as open("\x41\xcc\x88",...) with a decomposed "Ä".

As a consequence, readdir() returns the file names in decomposed
unicode, even if the user expects precomposed unicode.  Unlike on
HFS+, Mac OS X stores files on a VFAT drive (e.g. an USB drive) in
precomposed unicode, but readdir() still returns file names in
decomposed unicode.  When a git repository is stored on a network
share using SAMBA, file names are send over the wire and written to
disk on the remote system in precomposed unicode, but Mac OS X
readdir() returns decomposed unicode to be compatible with its
behaviour on HFS+ and VFAT.

The unicode decomposition causes many problems:

- The names "git add" and other commands get from the end user may
  often be precomposed form (the decomposed form is not easily input
  from the keyboard), but when the commands read from the filesystem
  to see what it is going to update the index with already is on the
  filesystem, readdir() will give decomposed form, which is different.

- Similarly "git log", "git mv" and all other commands that need to
  compare pathnames found on the command line (often but not always
  precomposed form; a command line input resulting from globbing may
  be in decomposed) with pathnames found in the tree objects (should
  be precomposed form to be compatible with other systems and for
  consistency in general).

- The same for names stored in the index, which should be
  precomposed, that may need to be compared with the names read from
  readdir().

NFS mounted from Linux is fully transparent and does not suffer from
the above.

As Mac OS X treats precomposed and decomposed file names as equal,
we can

 - wrap readdir() on Mac OS X to return the precomposed form, and

 - normalize decomposed form given from the command line also to the
   precomposed form,

to ensure that all pathnames used in Git are always in the
precomposed form.  This behaviour can be requested by setting
"core.precomposedunicode" configuration variable to true.

The code in compat/precomposed_utf8.c implements basically 4 new
functions: precomposed_utf8_opendir(), precomposed_utf8_readdir(),
precomposed_utf8_closedir() and precompose_argv().  The first three
are to wrap opendir(3), readdir(3), and closedir(3) functions.

The argv[] conversion allows to use the TAB filename completion done
by the shell on command line.  It tolerates other tools which use
readdir() to feed decomposed file names into git.

When creating a new git repository with "git init" or "git clone",
"core.precomposedunicode" will be set "false".

The user needs to activate this feature manually.  She typically
sets core.precomposedunicode to "true" on HFS and VFAT, or file
systems mounted via SAMBA.

Helped-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Torsten Bögershausen <tboegi@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agoReplace strlen() with ce_namelen()
Thomas Gummerer [Fri, 6 Jul 2012 16:07:30 +0000 (18:07 +0200)]
Replace strlen() with ce_namelen()

Replace strlen(ce->name) with ce_namelen() in a couple
of places which gives us some additional bits of
performance.

Signed-off-by: Thomas Gummerer <t.gummerer@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>