]> git.ipfire.org Git - thirdparty/git.git/log
thirdparty/git.git
11 years agowt-status: move wt_status_get_state() out to wt_status_print()
Nguyễn Thái Ngọc Duy [Wed, 13 Mar 2013 11:42:51 +0000 (18:42 +0700)] 
wt-status: move wt_status_get_state() out to wt_status_print()

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agowt-status: split wt_status_state parsing function out
Nguyễn Thái Ngọc Duy [Wed, 13 Mar 2013 11:42:50 +0000 (18:42 +0700)] 
wt-status: split wt_status_state parsing function out

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agowt-status: move strbuf into read_and_strip_branch()
Nguyễn Thái Ngọc Duy [Sat, 16 Mar 2013 02:12:36 +0000 (09:12 +0700)] 
wt-status: move strbuf into read_and_strip_branch()

The strbufs are placed outside read_and_strip_branch as a premature
optimization: when it reads "refs/heads/foo" to strbuf and wants to
return just "foo", it could do so without memory movement. In return
the caller must not use the returned pointer after releasing strbufs,
which own the buffers that contain the returned strings. It's a clumsy
design.

By moving strbufs into read_and_strip_branch(), the returned pointer
always points to a malloc'd buffer or NULL. The pointer can be passed
around and freed after use.

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agoMerge branch 'jc/reflog-reverse-walk' into nd/branch-show-rebase-bisect-state
Junio C Hamano [Wed, 13 Mar 2013 16:29:23 +0000 (09:29 -0700)] 
Merge branch 'jc/reflog-reverse-walk' into nd/branch-show-rebase-bisect-state

* jc/reflog-reverse-walk:
  reflog: add for_each_reflog_ent_reverse() API
  for_each_recent_reflog_ent(): simplify opening of a reflog file
  for_each_reflog_ent(): extract a helper to process a single entry

11 years agoreflog: add for_each_reflog_ent_reverse() API
Junio C Hamano [Fri, 8 Mar 2013 21:27:37 +0000 (13:27 -0800)] 
reflog: add for_each_reflog_ent_reverse() API

"git checkout -" is a short-hand for "git checkout @{-1}" and the
"@{nth}" notation for a negative number is to find nth previous
checkout in the reflog of the HEAD to determine the name of the
branch the user was on.  We would want to find the nth most recent
reflog entry that matches "checkout: moving from X to Y" for this.

Unfortunately, reflog is implemented as an append-only file, and the
API to iterate over its entries, for_each_reflog_ent(), reads the
file in order, giving the entries from the oldest to newer.  For the
purpose of finding nth most recent one, this API forces us to record
the last n entries in a rotating buffer and give the result out only
after we read everything.  To optimize for a common case of finding
the nth most recent one for a small value of n, we also have a side
API for_each_recent_reflog_ent() that starts reading near the end of
the file, but it still has to read the entries in the "wrong" order.
The implementation of understanding @{-1} uses this interface.

This all becomes unnecessary if we add an API to let us iterate over
reflog entries in the reverse order, from the newest to older.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agofor_each_recent_reflog_ent(): simplify opening of a reflog file
Junio C Hamano [Fri, 8 Mar 2013 18:45:25 +0000 (10:45 -0800)] 
for_each_recent_reflog_ent(): simplify opening of a reflog file

There is no reason to use a temporary variable logfile.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agofor_each_reflog_ent(): extract a helper to process a single entry
Junio C Hamano [Fri, 8 Mar 2013 18:36:43 +0000 (10:36 -0800)] 
for_each_reflog_ent(): extract a helper to process a single entry

Split the logic that takes a single line of reflog entry in a
strbuf, parses the message, and calls the callback function out of
the loop into a separate helper function.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agostatus: show the branch name if possible in in-progress info
Nguyễn Thái Ngọc Duy [Sun, 3 Feb 2013 05:53:27 +0000 (12:53 +0700)] 
status: show the branch name if possible in in-progress info

The typical use-case is starting a rebase, do something else, come
back the day after, run "git status" or make a new commit and wonder
what in the world's going on. Which branch is being rebased is
probably the most useful tidbit to help, but the target may help
too.

Ideally, I would have loved to see "rebasing master on
origin/master", but the target ref name is not stored during rebase,
so this patch writes "rebasing master on a78c8c98b" as a
half-measure to remind future users of that potential improvement.

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agoUpdate draft release notes to 1.8.2
Junio C Hamano [Fri, 1 Feb 2013 20:52:08 +0000 (12:52 -0800)] 
Update draft release notes to 1.8.2

Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agoMerge branch 'nd/edit-branch-desc-while-detached'
Junio C Hamano [Fri, 1 Feb 2013 20:40:52 +0000 (12:40 -0800)] 
Merge branch 'nd/edit-branch-desc-while-detached'

Attempt to "branch --edit-description" an existing branch, while
being on a detached HEAD, errored out.

* nd/edit-branch-desc-while-detached:
  branch: no detached HEAD check when editing another branch's description

11 years agoMerge branch 'jk/gc-auto-after-fetch'
Junio C Hamano [Fri, 1 Feb 2013 20:40:16 +0000 (12:40 -0800)] 
Merge branch 'jk/gc-auto-after-fetch'

Help "fetch only" repositories that do not trigger "gc --auto"
often enough.

* jk/gc-auto-after-fetch:
  fetch-pack: avoid repeatedly re-scanning pack directory
  fetch: run gc --auto after fetching

11 years agoMerge branch 'bc/git-p4-for-python-2.4'
Junio C Hamano [Fri, 1 Feb 2013 20:40:10 +0000 (12:40 -0800)] 
Merge branch 'bc/git-p4-for-python-2.4'

With small updates to remove dependency on newer features of
Python, keep git-p4 usable with older Python.

* bc/git-p4-for-python-2.4:
  INSTALL: git-p4 does not support Python 3
  git-p4.py: support Python 2.4
  git-p4.py: support Python 2.5

11 years agoMerge branch 'jn/do-not-drop-username-when-reading-from-etc-mailname'
Junio C Hamano [Fri, 1 Feb 2013 20:40:05 +0000 (12:40 -0800)] 
Merge branch 'jn/do-not-drop-username-when-reading-from-etc-mailname'

We used to stuff "user@" and then append what we read from
/etc/mailname to come up with a default e-mail ident, but a bug
lost the "user@" part.  This is to fix it.

* jn/do-not-drop-username-when-reading-from-etc-mailname:
  ident: do not drop username when reading from /etc/mailname

11 years agoMerge branch 'jk/cvsimport-does-not-work-with-cvsps3'
Junio C Hamano [Fri, 1 Feb 2013 20:39:59 +0000 (12:39 -0800)] 
Merge branch 'jk/cvsimport-does-not-work-with-cvsps3'

Warn people that other tools are more recommendable over
cvsimport+cvsps2 combo when doing a one-shot import, and cvsimport
will not work with cvsps3.

* jk/cvsimport-does-not-work-with-cvsps3:
  git-cvsimport.txt: cvsps-2 is deprecated

11 years agoMerge branch 'jc/do-not-let-random-file-interfere-with-completion-tests'
Junio C Hamano [Fri, 1 Feb 2013 20:39:46 +0000 (12:39 -0800)] 
Merge branch 'jc/do-not-let-random-file-interfere-with-completion-tests'

Scripts to test bash completion was inherently flaky as it was
affected by whatever random things the user may have on $PATH.

* jc/do-not-let-random-file-interfere-with-completion-tests:
  t9902: protect test from stray build artifacts

11 years agoMerge branch 'as/test-cleanup'
Junio C Hamano [Fri, 1 Feb 2013 20:39:42 +0000 (12:39 -0800)] 
Merge branch 'as/test-cleanup'

* as/test-cleanup:
  t7102 (reset): don't hardcode SHA-1 in expected outputs

11 years agoMerge branch 'jc/no-git-config-in-clone'
Junio C Hamano [Fri, 1 Feb 2013 20:39:36 +0000 (12:39 -0800)] 
Merge branch 'jc/no-git-config-in-clone'

We stopped paying attention to $GIT_CONFIG environment that points
at a single configuration file from any command other than "git config"
quite a while ago, but "git clone" internally set, exported, and
then unexported the variable during its operation unnecessarily.

* jc/no-git-config-in-clone:
  clone: do not export and unexport GIT_CONFIG

11 years agoMerge branch 'nd/fetch-depth-is-broken'
Junio C Hamano [Fri, 1 Feb 2013 20:39:24 +0000 (12:39 -0800)] 
Merge branch 'nd/fetch-depth-is-broken'

"git fetch --depth" was broken in at least three ways.  The
resulting history was deeper than specified by one commit, it was
unclear how to wipe the shallowness of the repository with the
command, and documentation was misleading.

* nd/fetch-depth-is-broken:
  fetch: elaborate --depth action
  upload-pack: fix off-by-one depth calculation in shallow clone
  fetch: add --unshallow for turning shallow repo into complete one

11 years agoMerge git://ozlabs.org/~paulus/gitk
Junio C Hamano [Wed, 30 Jan 2013 21:52:44 +0000 (13:52 -0800)] 
Merge git://ozlabs.org/~paulus/gitk

* git://ozlabs.org/~paulus/gitk:
  gitk: Ignore gitk-wish buildproduct

11 years agoINSTALL: git-p4 does not support Python 3
Junio C Hamano [Wed, 30 Jan 2013 19:17:59 +0000 (11:17 -0800)] 
INSTALL: git-p4 does not support Python 3

Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agobranch: no detached HEAD check when editing another branch's description
Nguyễn Thái Ngọc Duy [Mon, 28 Jan 2013 01:18:13 +0000 (08:18 +0700)] 
branch: no detached HEAD check when editing another branch's description

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agoMerge branch 'rr/minimal-stat'
Junio C Hamano [Wed, 30 Jan 2013 16:53:02 +0000 (08:53 -0800)] 
Merge branch 'rr/minimal-stat'

Some reimplementations of Git does not write all the stat info back
to the index due to their implementation limitations (e.g. jgit
running on Java).  A configuration option can tell Git to ignore
changes to most of the stat fields and only pay attention to mtime
and size, which these implementations can reliably update.  This
avoids excessive revalidation of contents.

* rr/minimal-stat:
  Enable minimal stat checking

11 years agoMerge branch 'nd/magic-pathspec-from-root'
Junio C Hamano [Wed, 30 Jan 2013 16:52:53 +0000 (08:52 -0800)] 
Merge branch 'nd/magic-pathspec-from-root'

When giving arguments without "--" disambiguation, object names
that come  earlier on the command line must not be interpretable as
pathspecs and pathspecs that come later on the command line must
not be interpretable as object names.  Tweak the disambiguation
rule so that ":/" (no other string before or after) is always
interpreted as a pathspec, to avoid having to say "git cmd -- :/".

* nd/magic-pathspec-from-root:
  grep: avoid accepting ambiguous revision
  Update :/abc ambiguity check

11 years agoMerge branch 'maint'
Junio C Hamano [Wed, 30 Jan 2013 16:07:30 +0000 (08:07 -0800)] 
Merge branch 'maint'

* maint:
  README: update stale and/or incorrect information

11 years agoMerge branch 'tb/t0050-maint' into maint
Junio C Hamano [Wed, 30 Jan 2013 15:47:46 +0000 (07:47 -0800)] 
Merge branch 'tb/t0050-maint' into maint

Update tests that were expecting to fail due to a bug that was
fixed earlier.

* tb/t0050-maint:
  t0050: Use TAB for indentation
  t0050: honor CASE_INSENSITIVE_FS in add (with different case)
  t0050: known breakage vanished in merge (case change)

11 years agogitk: Ignore gitk-wish buildproduct
Christian Couder [Wed, 23 Jan 2013 20:00:35 +0000 (12:00 -0800)] 
gitk: Ignore gitk-wish buildproduct

gitk, when bound into the git.git project tree, used to live at the
root level, but in 62ba514 (Move gitk to its own subdirectory,
2007-11-17) it was moved to a subdirectory.  The code used to track
changes to TCLTK_PATH (which should cause gitk to be rebuilt to
point at the new interpreter) was left in the main Makefile instead
of being moved to the new Makefile that was created for the gitk
project.

Also add .gitignore file to list build artifacts for the gitk
project.

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
11 years agoMerge branch 'nd/fix-directory-attrs-off-by-one' into maint
Junio C Hamano [Tue, 29 Jan 2013 19:18:54 +0000 (11:18 -0800)] 
Merge branch 'nd/fix-directory-attrs-off-by-one' into maint

The attribute mechanism didn't allow limiting attributes to be
applied to only a single directory itself with "path/" like the
exclude mechanism does.  The initial implementation of this that was
merged to 'maint' and 1.8.1.1 had severe performance degradations.

* nd/fix-directory-attrs-off-by-one:
  attr: avoid calling find_basename() twice per path
  attr: fix off-by-one directory component length calculation

11 years agoMerge branch 'ph/rebase-preserve-all-merges' into maint
Junio C Hamano [Tue, 29 Jan 2013 19:18:31 +0000 (11:18 -0800)] 
Merge branch 'ph/rebase-preserve-all-merges' into maint

"git rebase --preserve-merges" lost empty merges in recent versions
of Git.

* ph/rebase-preserve-all-merges:
  rebase --preserve-merges: keep all merge commits including empty ones

11 years agoREADME: update stale and/or incorrect information
Junio C Hamano [Tue, 29 Jan 2013 19:10:58 +0000 (11:10 -0800)] 
README: update stale and/or incorrect information

Ramkumar Ramachandra noticed that the old address for the marc
archive no longer works.  Update it to its marc.info address,
and also refer to the gmane site.

Remove the reference to "note from the maintainer", which is not
usually followed by any useful discussion on status, direction nor
tasks.

Also replace the reference to "What's in git.git" with "What's
cooking".

Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agoUpdate draft release notes to 1.8.2
Junio C Hamano [Mon, 28 Jan 2013 19:19:59 +0000 (11:19 -0800)] 
Update draft release notes to 1.8.2

Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agoSync with 1.8.1.2
Junio C Hamano [Mon, 28 Jan 2013 19:18:32 +0000 (11:18 -0800)] 
Sync with 1.8.1.2

11 years agoGit 1.8.1.2 v1.8.1.2
Junio C Hamano [Mon, 28 Jan 2013 19:17:54 +0000 (11:17 -0800)] 
Git 1.8.1.2

Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agoMerge branch 'ss/help-htmlpath-config-doc' into maint
Junio C Hamano [Mon, 28 Jan 2013 19:13:31 +0000 (11:13 -0800)] 
Merge branch 'ss/help-htmlpath-config-doc' into maint

* ss/help-htmlpath-config-doc:
  config.txt: Document help.htmlpath config parameter

11 years agoMerge branch 'nd/attr-debug-fix' into maint
Junio C Hamano [Mon, 28 Jan 2013 19:13:07 +0000 (11:13 -0800)] 
Merge branch 'nd/attr-debug-fix' into maint

* nd/attr-debug-fix:
  attr: make it build with DEBUG_ATTR again

11 years agoMerge branch 'ds/completion-silence-in-tree-path-probe' into maint
Junio C Hamano [Mon, 28 Jan 2013 19:12:47 +0000 (11:12 -0800)] 
Merge branch 'ds/completion-silence-in-tree-path-probe' into maint

* ds/completion-silence-in-tree-path-probe:
  git-completion.bash: silence "not a valid object" errors

11 years agoMerge branch 'jn/maint-trim-vim-contrib' into maint
Junio C Hamano [Mon, 28 Jan 2013 19:12:36 +0000 (11:12 -0800)] 
Merge branch 'jn/maint-trim-vim-contrib' into maint

* jn/maint-trim-vim-contrib:
  contrib/vim: simplify instructions for old vim support

11 years agoMerge branch 'pe/doc-email-env-is-trumped-by-config' into maint
Junio C Hamano [Mon, 28 Jan 2013 19:12:31 +0000 (11:12 -0800)] 
Merge branch 'pe/doc-email-env-is-trumped-by-config' into maint

* pe/doc-email-env-is-trumped-by-config:
  git-commit-tree(1): correct description of defaults

11 years agoMerge branch 'mk/complete-tcsh' into maint
Junio C Hamano [Mon, 28 Jan 2013 19:11:51 +0000 (11:11 -0800)] 
Merge branch 'mk/complete-tcsh' into maint

Command line completion for "tcsh" emitted an unwanted space
after completing a single directory name.

* mk/complete-tcsh:
  Prevent space after directories in tcsh completion

11 years agoMerge branch 'ap/status-ignored-in-ignored-directory' into maint
Junio C Hamano [Mon, 28 Jan 2013 19:10:25 +0000 (11:10 -0800)] 
Merge branch 'ap/status-ignored-in-ignored-directory' into maint

Output from "git status --ignored" did not work well when used with
"--untracked".

* ap/status-ignored-in-ignored-directory:
  status: always report ignored tracked directories
  git-status: Test --ignored behavior
  dir.c: Make git-status --ignored more consistent

11 years agoMerge branch 'er/stop-recommending-parsecvs' into maint
Junio C Hamano [Mon, 28 Jan 2013 19:09:37 +0000 (11:09 -0800)] 
Merge branch 'er/stop-recommending-parsecvs' into maint

* er/stop-recommending-parsecvs:
  Remove the suggestion to use parsecvs, which is currently broken.

11 years agoMerge branch 'mh/ceiling' into maint
Junio C Hamano [Mon, 28 Jan 2013 19:07:18 +0000 (11:07 -0800)] 
Merge branch 'mh/ceiling' into maint

An element on GIT_CEILING_DIRECTORIES list that does not name the
real path to a directory (i.e. a symbolic link) could have caused
the GIT_DIR discovery logic to escape the ceiling.

* mh/ceiling:
  string_list_longest_prefix(): remove function
  setup_git_directory_gently_1(): resolve symlinks in ceiling paths
  longest_ancestor_length(): require prefix list entries to be normalized
  longest_ancestor_length(): take a string_list argument for prefixes
  longest_ancestor_length(): use string_list_split()
  Introduce new function real_path_if_valid()
  real_path_internal(): add comment explaining use of cwd
  Introduce new static function real_path_internal()

11 years agoMerge branch 'tb/t0050-maint'
Junio C Hamano [Mon, 28 Jan 2013 18:59:28 +0000 (10:59 -0800)] 
Merge branch 'tb/t0050-maint'

Update tests that were expecting to fail due to a bug that was
fixed earlier.

* tb/t0050-maint:
  t0050: Use TAB for indentation
  t0050: honor CASE_INSENSITIVE_FS in add (with different case)
  t0050: known breakage vanished in merge (case change)

11 years agoMerge branch 'dl/am-hg-locale'
Junio C Hamano [Mon, 28 Jan 2013 18:59:24 +0000 (10:59 -0800)] 
Merge branch 'dl/am-hg-locale'

Datestamp recorded in "Hg" format patch was reformatted incorrectly
to an e-mail looking date using locale dependant strftime, causing
patch application to fail.

* dl/am-hg-locale:
  am: invoke perl's strftime in C locale

11 years agoMerge branch 'jc/help'
Junio C Hamano [Mon, 28 Jan 2013 18:59:15 +0000 (10:59 -0800)] 
Merge branch 'jc/help'

A header file that has the definition of a static array was
included in two places, wasting the space.

* jc/help:
  help: include <common-cmds.h> only in one file

11 years agoMerge branch 'bc/fix-array-syntax-for-3.0-in-completion-bash'
Junio C Hamano [Mon, 28 Jan 2013 18:59:07 +0000 (10:59 -0800)] 
Merge branch 'bc/fix-array-syntax-for-3.0-in-completion-bash'

Fix use of an array notation that older versions of bash do not
understand.

* bc/fix-array-syntax-for-3.0-in-completion-bash:
  git-completion.bash: replace zsh notation that breaks bash 3.X

11 years agoMerge branch 'jk/maint-gc-auto-after-fetch' into jk/gc-auto-after-fetch
Junio C Hamano [Sun, 27 Jan 2013 03:42:09 +0000 (19:42 -0800)] 
Merge branch 'jk/maint-gc-auto-after-fetch' into jk/gc-auto-after-fetch

* jk/maint-gc-auto-after-fetch:
  fetch-pack: avoid repeatedly re-scanning pack directory
  fetch: run gc --auto after fetching

11 years agofetch-pack: avoid repeatedly re-scanning pack directory
Jeff King [Sat, 26 Jan 2013 22:40:43 +0000 (17:40 -0500)] 
fetch-pack: avoid repeatedly re-scanning pack directory

When we look up a sha1 object for reading via parse_object() =>
read_sha1_file() => read_object() callpath, we first check
packfiles, and then loose objects. If we still haven't found it, we
re-scan the list of packfiles in `objects/pack`. This final step
ensures that we can co-exist with a simultaneous repack process
which creates a new pack and then prunes the old object.

This extra re-scan usually does not have a performance impact for
two reasons:

  1. If an object is missing, then typically the re-scan will find a
     new pack, then no more misses will occur.  Or if it truly is
     missing, then our next step is usually to die().

  2. Re-scanning is cheap enough that we do not even notice.

However, these do not always hold. The assumption in (1) is that the
caller is expecting to find the object. This is usually the case,
but the call to `parse_object` in `everything_local` does not follow
this pattern. It is looking to see whether we have objects that the
remote side is advertising, not something we expect to
have. Therefore if we are fetching from a remote which has many refs
pointing to objects we do not have, we may end up re-scanning the
pack directory many times.

Even with this extra re-scanning, the impact is often not noticeable
due to (2); we just readdir() the packs directory and skip any packs
that are already loaded. However, if there are a large number of
packs, even enumerating the directory can be expensive, especially
if we do it repeatedly.

Having this many packs is a good sign the user should run `git gc`,
but it would still be nice to avoid having to scan the directory at
all.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agofetch: run gc --auto after fetching
Jeff King [Sat, 26 Jan 2013 22:40:38 +0000 (17:40 -0500)] 
fetch: run gc --auto after fetching

We generally try to run "gc --auto" after any commands that
might introduce a large number of new objects. An obvious
place to do so is after running "fetch", which may introduce
new loose objects or packs (depending on the size of the
fetch).

While an active developer repository will probably
eventually trigger a "gc --auto" on another action (e.g.,
git-rebase), there are two good reasons why it is nicer to
do it at fetch time:

  1. Read-only repositories which track an upstream (e.g., a
     continuous integration server which fetches and builds,
     but never makes new commits) will accrue loose objects
     and small packs, but never coalesce them into a more
     efficient larger pack.

  2. Fetching is often already perceived to be slow to the
     user, since they have to wait on the network. It's much
     more pleasant to include a potentially slow auto-gc as
     part of the already-long network fetch than in the
     middle of productive work with git-rebase or similar.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agogit-p4.py: support Python 2.4
Brandon Casey [Sat, 26 Jan 2013 19:14:33 +0000 (11:14 -0800)] 
git-p4.py: support Python 2.4

Python 2.4 lacks the following features:

   subprocess.check_call
   struct.pack_into

Take a cue from 460d1026 and provide an implementation of the
CalledProcessError exception.  Then replace the calls to
subproccess.check_call with calls to subprocess.call that check the return
status and raise a CalledProcessError exception if necessary.

The struct.pack_into in t/9802 can be converted into a single struct.pack
call which is available in Python 2.4.

Signed-off-by: Brandon Casey <bcasey@nvidia.com>
Acked-by: Pete Wyckoff <pw@padd.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agogit-p4.py: support Python 2.5
Brandon Casey [Sat, 26 Jan 2013 19:14:32 +0000 (11:14 -0800)] 
git-p4.py: support Python 2.5

Python 2.5 and older do not accept None as the first argument to
translate() and complain with:

   TypeError: expected a character buffer object

As suggested by Pete Wyckoff, let's just replace the call to translate()
with a regex search which should be more clear and more portable.

This allows git-p4 to be used with Python 2.5.

Signed-off-by: Brandon Casey <bcasey@nvidia.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agoMerge branch 'for-junio' of git://bogomips.org/git-svn
Junio C Hamano [Fri, 25 Jan 2013 20:53:31 +0000 (12:53 -0800)] 
Merge branch 'for-junio' of git://bogomips.org/git-svn

* 'for-junio' of git://bogomips.org/git-svn:
  git-svn: Simplify calculation of GIT_DIR
  git-svn: cleanup sprintf usage for uppercasing hex

11 years agoUpdate draft release notes to 1.8.2
Junio C Hamano [Fri, 25 Jan 2013 20:52:55 +0000 (12:52 -0800)] 
Update draft release notes to 1.8.2

Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agoMerge branch 'nd/retire-fnmatch'
Junio C Hamano [Fri, 25 Jan 2013 20:34:55 +0000 (12:34 -0800)] 
Merge branch 'nd/retire-fnmatch'

Replace our use of fnmatch(3) with a more feature-rich wildmatch.
A handful patches at the bottom have been moved to nd/wildmatch to
graduate as part of that branch, before this series solidifies.

We may want to mark USE_WILDMATCH as an experimental curiosity a
bit more clearly (i.e. should not be enabled in production
environment, because it will make the behaviour between builds
unpredictable).

* nd/retire-fnmatch:
  Makefile: add USE_WILDMATCH to use wildmatch as fnmatch
  wildmatch: advance faster in <asterisk> + <literal> patterns
  wildmatch: make a special case for "*/" with FNM_PATHNAME
  test-wildmatch: add "perf" command to compare wildmatch and fnmatch
  wildmatch: support "no FNM_PATHNAME" mode
  wildmatch: make dowild() take arbitrary flags
  wildmatch: rename constants and update prototype

11 years agoMerge branch 'jc/doc-maintainer'
Junio C Hamano [Fri, 25 Jan 2013 20:34:52 +0000 (12:34 -0800)] 
Merge branch 'jc/doc-maintainer'

Describe tools for automation that were invented since this
document was originally written.

* jc/doc-maintainer:
  howto/maintain: document "### match next" convention in jch/pu branch
  howto/maintain: mark titles for asciidoc
  Documentation: update "howto maintain git"

11 years agohowto/maintain: document "### match next" convention in jch/pu branch
Junio C Hamano [Fri, 25 Jan 2013 20:33:57 +0000 (12:33 -0800)] 
howto/maintain: document "### match next" convention in jch/pu branch

Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agoident: do not drop username when reading from /etc/mailname
Jonathan Nieder [Thu, 24 Jan 2013 23:21:46 +0000 (15:21 -0800)] 
ident: do not drop username when reading from /etc/mailname

An earlier conversion from fgets() to strbuf_getline() in the
codepath to read from /etc/mailname to learn the default host-part
of the ident e-mail address forgot that strbuf_getline() stores the
line at the beginning of the buffer just like fgets().

The "username@" the caller has prepared in the strbuf, expecting the
function to append the host-part to it, was lost because of this.

Reported-by: Mihai Rusu <dizzy@google.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Acked-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agot9902: protect test from stray build artifacts
Junio C Hamano [Thu, 24 Jan 2013 23:08:37 +0000 (15:08 -0800)] 
t9902: protect test from stray build artifacts

When you have random build artifacts in your build directory, left
behind by running "make" while on another branch, the "git help -a"
command run by __git_list_all_commands in the completion script that
is being tested does not have a way to know that they are not part
of the subcommands this build will ship.  Such extra subcommands may
come from the user's $PATH.  They will interfere with the tests that
expect a certain prefix to uniquely expand to a known completion.

Instrument the completion script and give it a way for us to tell
what (subset of) subcommands we are going to ship.

Also add a test to "git --help <prefix><TAB>" expansion.  It needs
to show not just commands but some selected documentation pages.

Based on an idea by Jeff King.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agot7102 (reset): don't hardcode SHA-1 in expected outputs
Alexey Shumkin [Thu, 24 Jan 2013 09:10:26 +0000 (13:10 +0400)] 
t7102 (reset): don't hardcode SHA-1 in expected outputs

Take the expected SHA-1 digest in a variable, and use it instead of
hardcoding when checking the result.

Signed-off-by: Alexey Shumkin <Alex.Crezoff@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agogit-cvsimport.txt: cvsps-2 is deprecated
John Keeping [Thu, 24 Jan 2013 19:18:45 +0000 (19:18 +0000)] 
git-cvsimport.txt: cvsps-2 is deprecated

git-cvsimport relies on version 2 of cvsps and does not work with the
new version 3.  Since cvsps 3.x does not currently work as well as
version 2 for incremental import, document this fact.

Specifically, there is no way to make new git-cvsimport that supports
cvsps 3.x and have a seamless transition for existing users since cvsps
3.x needs a time from which to continue importing and git-cvsimport does
not save the time of the last import or import into a specific namespace
so there is no safe way to calculate the time of the last import.

Signed-off-by: John Keeping <john@keeping.me.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agogit-svn: Simplify calculation of GIT_DIR
Barry Wardell [Mon, 21 Jan 2013 01:22:02 +0000 (01:22 +0000)] 
git-svn: Simplify calculation of GIT_DIR

Since git-rev-parse already checks for the $GIT_DIR environment
variable and that it returns an actual git repository, there is no
need to repeat the checks again here.

This also fixes a problem where git-svn did not work in cases where
.git was a file with a gitdir: link.

[ew: squashed test case,
 delay setting GIT_DIR until after `git rev-parse --cdup` to fix t9101,
 (thanks to Junio)]

Signed-off-by: Barry Wardell <barry.wardell@gmail.com>
Signed-off-by: Eric Wong <normalperson@yhbt.net>
11 years agogit-svn: cleanup sprintf usage for uppercasing hex
Eric Wong [Thu, 24 Jan 2013 00:23:44 +0000 (00:23 +0000)] 
git-svn: cleanup sprintf usage for uppercasing hex

We do not need to call uc() separately for sprintf("%x")
as sprintf("%X") is available.

Signed-off-by: Eric Wong <normalperson@yhbt.net>
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
11 years agoMerge branch 'as/pre-push-hook'
Junio C Hamano [Thu, 24 Jan 2013 05:19:25 +0000 (21:19 -0800)] 
Merge branch 'as/pre-push-hook'

Add an extra hook so that "git push" that is run without making
sure what is being pushed is sane can be checked and rejected (as
opposed to the user deciding not pushing).

* as/pre-push-hook:
  Add sample pre-push hook script
  push: Add support for pre-push hooks
  hooks: Add function to check if a hook exists

11 years agoMerge branch 'ch/add-auto-submitted-in-sample-post-receive-email'
Junio C Hamano [Thu, 24 Jan 2013 05:19:19 +0000 (21:19 -0800)] 
Merge branch 'ch/add-auto-submitted-in-sample-post-receive-email'

* ch/add-auto-submitted-in-sample-post-receive-email:
  Add Auto-Submitted header to post-receive-email

11 years agoMerge branch 'as/check-ignore'
Junio C Hamano [Thu, 24 Jan 2013 05:19:10 +0000 (21:19 -0800)] 
Merge branch 'as/check-ignore'

Add a new command "git check-ignore" for debugging .gitignore
files.

The variable names may want to get cleaned up but that can be done
in-tree.

* as/check-ignore:
  clean.c, ls-files.c: respect encapsulation of exclude_list_groups
  t0008: avoid brace expansion
  add git-check-ignore sub-command
  setup.c: document get_pathspec()
  add.c: extract new die_if_path_beyond_symlink() for reuse
  add.c: extract check_path_for_gitlink() from treat_gitlinks() for reuse
  pathspec.c: rename newly public functions for clarity
  add.c: move pathspec matchers into new pathspec.c for reuse
  add.c: remove unused argument from validate_pathspec()
  dir.c: improve docs for match_pathspec() and match_pathspec_depth()
  dir.c: provide clear_directory() for reclaiming dir_struct memory
  dir.c: keep track of where patterns came from
  dir.c: use a single struct exclude_list per source of excludes

Conflicts:
builtin/ls-files.c
dir.c

11 years agoMerge branch 'rs/clarify-entry-cmp-sslice'
Junio C Hamano [Thu, 24 Jan 2013 05:19:06 +0000 (21:19 -0800)] 
Merge branch 'rs/clarify-entry-cmp-sslice'

* rs/clarify-entry-cmp-sslice:
  refs: use strncmp() instead of strlen() and memcmp()

11 years agoMerge branch 'jk/suppress-clang-warning'
Junio C Hamano [Thu, 24 Jan 2013 05:19:00 +0000 (21:19 -0800)] 
Merge branch 'jk/suppress-clang-warning'

* jk/suppress-clang-warning:
  fix clang -Wunused-value warnings for error functions

11 years agoMerge branch 'cr/push-force-tag-update'
Junio C Hamano [Thu, 24 Jan 2013 05:16:49 +0000 (21:16 -0800)] 
Merge branch 'cr/push-force-tag-update'

Regression fix to stop "git push" complaining "target ref already
exists", when it is not the real reason the command rejected the
request (e.g. non-fast-forward).

* cr/push-force-tag-update:
  push: fix "refs/tags/ hierarchy cannot be updated without --force"

11 years agoMerge branch 'mh/imap-send-shrinkage'
Junio C Hamano [Thu, 24 Jan 2013 05:16:45 +0000 (21:16 -0800)] 
Merge branch 'mh/imap-send-shrinkage'

Remove a lot of unused code from "git imap-send".

* mh/imap-send-shrinkage:
  imap-send.c: simplify logic in lf_to_crlf()
  imap-send.c: fold struct store into struct imap_store
  imap-send.c: remove unused field imap_store::uidvalidity
  imap-send.c: use struct imap_store instead of struct store
  imap-send.c: remove unused field imap_store::trashnc
  imap-send.c: remove namespace fields from struct imap
  imap-send.c: remove struct imap argument to parse_imap_list_l()
  imap-send.c: inline parse_imap_list() in parse_list()
  imap-send.c: remove some unused fields from struct store
  imap-send.c: remove struct message
  imap-send.c: remove struct store_conf
  iamp-send.c: remove unused struct imap_store_conf
  imap-send.c: remove struct msg_data
  imap-send.c: remove msg_data::flags, which was always zero

11 years agoMerge branch 'mo/cvs-server-updates'
Junio C Hamano [Thu, 24 Jan 2013 05:16:38 +0000 (21:16 -0800)] 
Merge branch 'mo/cvs-server-updates'

Various git-cvsserver updates.

* mo/cvs-server-updates:
  t9402: Use TABs for indentation
  t9402: Rename check.cvsCount and check.list
  t9402: Simplify git ls-tree
  t9402: Add missing &&; Code style
  t9402: No space after IO-redirection
  t9402: Dont use test_must_fail cvs
  t9402: improve check_end_tree() and check_end_full_tree()
  t9402: sed -i is not portable
  cvsserver Documentation: new cvs ... -r support
  cvsserver: add t9402 to test branch and tag refs
  cvsserver: support -r and sticky tags for most operations
  cvsserver: Add version awareness to argsfromdir
  cvsserver: generalize getmeta() to recognize commit refs
  cvsserver: implement req_Sticky and related utilities
  cvsserver: add misc commit lookup, file meta data, and file listing functions
  cvsserver: define a tag name character escape mechanism
  cvsserver: cleanup extra slashes in filename arguments
  cvsserver: factor out git-log parsing logic

11 years agoMerge branch 'jc/makefile-perl-python-path-doc'
Junio C Hamano [Thu, 24 Jan 2013 05:09:23 +0000 (21:09 -0800)] 
Merge branch 'jc/makefile-perl-python-path-doc'

* 'jc/makefile-perl-python-path-doc':
  Makefile: add description on PERL/PYTHON_PATH

11 years agoMerge git://ozlabs.org/~paulus/gitk
Junio C Hamano [Wed, 23 Jan 2013 16:35:03 +0000 (08:35 -0800)] 
Merge git://ozlabs.org/~paulus/gitk

* git://ozlabs.org/~paulus/gitk:
  gitk: Display important heads even when there are many
  gitk: Improve display of list of nearby tags and heads
  gitk: Fix display of branch names on some commits
  gitk: Update Swedish translation (296t)
  gitk: When searching, only highlight files when in Patch mode
  gitk: Fix error message when clicking on a connecting line
  gitk: Fix crash when not using themed widgets
  gitk: Use bindshiftfunctionkey to bind Shift-F5
  gitk: Refactor code for binding modified function keys
  gitk: Work around empty back and forward images when buttons are disabled
  gitk: Highlight first search result immediately on incremental search
  gitk: Highlight current search hit in orange
  gitk: Synchronize highlighting in file view when scrolling diff

11 years agoMerge branch 'jc/merge-blobs'
Junio C Hamano [Tue, 22 Jan 2013 18:48:20 +0000 (10:48 -0800)] 
Merge branch 'jc/merge-blobs'

* jc/merge-blobs:
  Makefile: Replace merge-file.h with merge-blobs.h in LIB_H

11 years agoMakefile: Replace merge-file.h with merge-blobs.h in LIB_H
Ramsay Jones [Tue, 22 Jan 2013 16:47:47 +0000 (16:47 +0000)] 
Makefile: Replace merge-file.h with merge-blobs.h in LIB_H

Commit fa2364ec ("Which merge_file() function do you mean?", 06-12-2012)
renamed the files merge-file.[ch] to merge-blobs.[ch], but forgot to
rename the header file in the definition of the LIB_H macro.

Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agoUpdate draft release notes to 1.8.2
Junio C Hamano [Tue, 22 Jan 2013 18:01:05 +0000 (10:01 -0800)] 
Update draft release notes to 1.8.2

Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agoMerge branch 'mz/reset-misc'
Junio C Hamano [Tue, 22 Jan 2013 17:36:13 +0000 (09:36 -0800)] 
Merge branch 'mz/reset-misc'

Various 'reset' optimizations and clean-ups, followed by a change
to allow "git reset" to work even on an unborn branch.

* mz/reset-misc:
  reset: update documentation to require only tree-ish with paths
  reset [--mixed]: use diff-based reset whether or not pathspec was given
  reset: allow reset on unborn branch
  reset $sha1 $pathspec: require $sha1 only to be treeish
  reset.c: inline update_index_refresh()
  reset.c: finish entire cmd_reset() whether or not pathspec is given
  reset [--mixed]: only write index file once
  reset.c: move lock, write and commit out of update_index_refresh()
  reset.c: move update_index_refresh() call out of read_from_tree()
  reset.c: replace switch by if-else
  reset: avoid redundant error message
  reset --keep: only write index file once
  reset.c: share call to die_if_unmerged_cache()
  reset.c: extract function for updating {ORIG_,}HEAD
  reset.c: remove unnecessary variable 'i'
  reset.c: extract function for parsing arguments
  reset: don't allow "git reset -- $pathspec" in bare repo
  reset.c: pass pathspec around instead of (prefix, argv) pair
  reset $pathspec: exit with code 0 if successful
  reset $pathspec: no need to discard index

11 years agoMerge branch 'nd/fix-directory-attrs-off-by-one'
Junio C Hamano [Tue, 22 Jan 2013 17:34:28 +0000 (09:34 -0800)] 
Merge branch 'nd/fix-directory-attrs-off-by-one'

Fix performance regression introduced by an earlier change to let
attributes apply to directories.

Needs to be merged to maint, as 94bc671a was merged there already.

* nd/fix-directory-attrs-off-by-one:
  attr: avoid calling find_basename() twice per path
  attr: fix off-by-one directory component length calculation

11 years agoEnable minimal stat checking
Robin Rosenberg [Tue, 22 Jan 2013 07:49:22 +0000 (08:49 +0100)] 
Enable minimal stat checking

Specifically the fields uid, gid, ctime, ino and dev are set to zero
by JGit. Other implementations, eg. Git in cygwin are allegedly also
somewhat incompatible with Git For Windows and on *nix platforms
the resolution of the timestamps may differ.

Any stat checking by git will then need to check content, which may
be very slow, particularly on Windows. Since mtime and size
is typically enough we should allow the user to tell git to avoid
checking these fields if they are set to zero in the index.

This change introduces a core.checkstat config option where the
the user can select to check all fields (default), or just size
and the whole second part of mtime (minimal).

Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agoMerge branch 'pw/p4-branch-fixes'
Junio C Hamano [Tue, 22 Jan 2013 04:15:44 +0000 (20:15 -0800)] 
Merge branch 'pw/p4-branch-fixes'

Fix "git p4" around branch handling.

* pw/p4-branch-fixes:
  git p4: fix submit when no master branch
  git p4 test: keep P4CLIENT changes inside subshells
  git p4: fix sync --branch when no master branch
  git p4: fail gracefully on sync with no master branch
  git p4: rearrange self.initialParent use
  git p4: allow short ref names to --branch
  git p4 doc: fix branch detection example
  git p4: clone --branch should checkout master
  git p4: verify expected refs in clone --bare test
  git p4: create p4/HEAD on initial clone
  git p4: inline listExistingP4GitBranches
  git p4: add comments to p4BranchesInGit
  git p4: rearrange and simplify hasOrigin handling
  git p4: test sync/clone --branch behavior

11 years agoMerge branch 'mh/remote-hg-mode-bits-fix'
Junio C Hamano [Tue, 22 Jan 2013 04:15:40 +0000 (20:15 -0800)] 
Merge branch 'mh/remote-hg-mode-bits-fix'

Update to the Hg remote helper (in contrib/).

* mh/remote-hg-mode-bits-fix:
  remote-hg: fix handling of file perms when pushing

11 years agoMerge branch 'fc/remote-hg-fixup-url'
Junio C Hamano [Tue, 22 Jan 2013 04:15:32 +0000 (20:15 -0800)] 
Merge branch 'fc/remote-hg-fixup-url'

Update to the Hg remote helper (in contrib/).

* fc/remote-hg-fixup-url:
  remote-hg: store converted URL

11 years agoMerge branch 'zk/clean-report-failure'
Junio C Hamano [Tue, 22 Jan 2013 04:15:24 +0000 (20:15 -0800)] 
Merge branch 'zk/clean-report-failure'

"git clean" states what it is going to remove and then goes on to
remove it, but sometimes it only discovers things that cannot be
removed after recursing into a directory, which makes the output
confusing and even wrong.

* zk/clean-report-failure:
  git-clean: Display more accurate delete messages

11 years agoMerge branch 'ph/rebase-preserve-all-merges'
Junio C Hamano [Tue, 22 Jan 2013 04:15:15 +0000 (20:15 -0800)] 
Merge branch 'ph/rebase-preserve-all-merges'

An earlier change to add --keep-empty option broke "git rebase
--preserve-merges" and lost merge commits that end up being the
same as its parent.

* ph/rebase-preserve-all-merges:
  rebase --preserve-merges: keep all merge commits including empty ones

11 years agoMerge branch 'nd/clone-no-separate-git-dir-with-bare'
Junio C Hamano [Tue, 22 Jan 2013 04:15:07 +0000 (20:15 -0800)] 
Merge branch 'nd/clone-no-separate-git-dir-with-bare'

Forbid a useless combination of options to "git clone".

* nd/clone-no-separate-git-dir-with-bare:
  clone: forbid --bare --separate-git-dir <dir>

11 years agoMerge branch 'maint'
Junio C Hamano [Tue, 22 Jan 2013 01:16:16 +0000 (17:16 -0800)] 
Merge branch 'maint'

* maint:
  git-for-each-ref.txt: 'raw' is a supported date format

11 years agot0050: Use TAB for indentation
Torsten Bögershausen [Mon, 21 Jan 2013 16:46:31 +0000 (17:46 +0100)] 
t0050: Use TAB for indentation

Use one TAB for indentation and remove empty lines

Signed-off-by: Torsten Bögershausen <tboegi@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agot0050: honor CASE_INSENSITIVE_FS in add (with different case)
Torsten Bögershausen [Mon, 21 Jan 2013 16:46:15 +0000 (17:46 +0100)] 
t0050: honor CASE_INSENSITIVE_FS in add (with different case)

The test case "add (with different case)" indicates a
known breakage when run on a case insensitive file system.

The test is invalid for case sensitive file system, it will always fail.

Check the precondition CASE_INSENSITIVE_FS before running it.

Signed-off-by: Torsten Bögershausen <tboegi@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agot0050: known breakage vanished in merge (case change)
Torsten Bögershausen [Mon, 21 Jan 2013 16:45:43 +0000 (17:45 +0100)] 
t0050: known breakage vanished in merge (case change)

This test case has passed since this commit:

  commit 0047dd2fd1fc1980913901c5fa098357482c2842
  Author: Steffen Prohaska <prohaska@zib.de>
  Date:   Thu May 15 07:19:54 2008 +0200

    t0050: Fix merge test on case sensitive file systems

Remove the known breakage by using test_expect_success

Signed-off-by: Torsten Bögershausen <tboegi@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agogrep: avoid accepting ambiguous revision
Nguyễn Thái Ngọc Duy [Mon, 21 Jan 2013 13:00:49 +0000 (20:00 +0700)] 
grep: avoid accepting ambiguous revision

Unlike other commands that take both revs and pathspecs without "--"
disamiguators only when the boundary is clear, "git grep" treated
what can be interpreted as a rev as-is, without making sure that it
could also have meant a pathspec.  E.g.

    $ git grep -e foo master

when 'master' is in the working tree, should have triggered an
ambiguity error, but it didn't, and searched in the tree of the
commit named by 'master'.

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agoUpdate :/abc ambiguity check
Nguyễn Thái Ngọc Duy [Mon, 21 Jan 2013 13:00:48 +0000 (20:00 +0700)] 
Update :/abc ambiguity check

:/abc may mean two things:

- as a revision, it means the revision that has "abc" in commit
  message.

- as a pathpec, it means "abc" from root.

Currently we see ":/abc" as a rev (most of the time), but never see it
as a pathspec even if "abc" exists and "git log :/abc" will gladly
take ":/abc" as rev even it's ambiguous. This patch makes it:

- ambiguous when "abc" exists on worktree
- a rev if abc does not exist on worktree
- a path if abc is not found in any commits (although better use
  "--" to avoid ambiguation because searching through commit DAG is
  expensive)

A plus from this patch is, because ":/" never matches anything as a
rev, it is never considered a valid rev and because root directory
always exists, ":/" is always unambiguously seen as a pathspec.

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agogit-for-each-ref.txt: 'raw' is a supported date format
John Keeping [Mon, 21 Jan 2013 16:22:06 +0000 (16:22 +0000)] 
git-for-each-ref.txt: 'raw' is a supported date format

Commit 7dff9b3 (Support 'raw' date format) added a raw date format.
Update the git-for-each-ref documentation to include this.

Signed-off-by: John Keeping <john@keeping.me.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agoUpdate draft release notes to 1.8.2
Junio C Hamano [Mon, 21 Jan 2013 01:28:13 +0000 (17:28 -0800)] 
Update draft release notes to 1.8.2

Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agoMerge branch 'maint'
Junio C Hamano [Mon, 21 Jan 2013 01:27:27 +0000 (17:27 -0800)] 
Merge branch 'maint'

11 years agoStart preparing for 1.8.1.2
Junio C Hamano [Mon, 21 Jan 2013 01:26:04 +0000 (17:26 -0800)] 
Start preparing for 1.8.1.2

Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agoMerge branch 'nz/send-email-headers-are-case-insensitive' into maint
Junio C Hamano [Mon, 21 Jan 2013 01:22:49 +0000 (17:22 -0800)] 
Merge branch 'nz/send-email-headers-are-case-insensitive' into maint

When users spell "cc:" in lowercase in the fake "header" in the
trailer part, "git send-email" failed to pick up the addresses from
there. As e-mail headers field names are case insensitive, this
script should follow suit and treat "cc:" and "Cc:" the same way.

* nz/send-email-headers-are-case-insensitive:
  git-send-email: treat field names as case-insensitively

11 years agoMerge branch 'rs/zip-with-uncompressed-size-in-the-header' into maint
Junio C Hamano [Mon, 21 Jan 2013 01:22:27 +0000 (17:22 -0800)] 
Merge branch 'rs/zip-with-uncompressed-size-in-the-header' into maint

"git archive" did not record uncompressed size in the header when
streaming a zip archive, which confused some implementations of
unzip.

* rs/zip-with-uncompressed-size-in-the-header:
  archive-zip: write uncompressed size into header even with streaming

11 years agoMerge branch 'rs/zip-tests' into maint
Junio C Hamano [Mon, 21 Jan 2013 01:22:22 +0000 (17:22 -0800)] 
Merge branch 'rs/zip-tests' into maint

* rs/zip-tests:
  t5003: check if unzip supports symlinks
  t5000, t5003: move ZIP tests into their own script
  t0024, t5000: use test_lazy_prereq for UNZIP
  t0024, t5000: clear variable UNZIP, use GIT_UNZIP instead

11 years agoMerge git://git.bogomips.org/git-svn
Junio C Hamano [Mon, 21 Jan 2013 01:08:46 +0000 (17:08 -0800)] 
Merge git://git.bogomips.org/git-svn

* git://git.bogomips.org/git-svn:
  git-svn: do not escape certain characters in paths

11 years agoMerge branch 'rt/commit-cleanup-config'
Junio C Hamano [Mon, 21 Jan 2013 01:07:04 +0000 (17:07 -0800)] 
Merge branch 'rt/commit-cleanup-config'

Add a configuration variable to set default clean-up mode other
than "strip".

* rt/commit-cleanup-config:
  commit: make default of "cleanup" option configurable

11 years agoMerge branch 'ap/log-mailmap'
Junio C Hamano [Mon, 21 Jan 2013 01:06:52 +0000 (17:06 -0800)] 
Merge branch 'ap/log-mailmap'

Teach commands in the "log" family to optionally pay attention to
the mailmap.

* ap/log-mailmap:
  log --use-mailmap: optimize for cases without --author/--committer search
  log: add log.mailmap configuration option
  log: grep author/committer using mailmap
  test: add test for --use-mailmap option
  log: add --use-mailmap option
  pretty: use mailmap to display username and email
  mailmap: add mailmap structure to rev_info and pp
  mailmap: simplify map_user() interface
  mailmap: remove email copy and length limitation
  Use split_ident_line to parse author and committer
  string-list: allow case-insensitive string list

11 years agogit-svn: do not escape certain characters in paths
Peter Wu [Thu, 17 Jan 2013 22:07:31 +0000 (23:07 +0100)] 
git-svn: do not escape certain characters in paths

Subversion 1.7 and newer implement HTTPv2, an extension that should make HTTP
more efficient. Servers with support for this protocol will make the subversion
client library take an alternative code path that checks (with assertions)
whether the URL is "canonical" or not.

This patch fixes an issue I encountered while trying to `git svn dcommit` a
rename action for a file containing a single quote character ("User's Manual"
to "UserMan.tex"). It does not happen for older subversion 1.6 servers nor
non-HTTP(S) protocols such as the native svn protocol, only on an Apache server
shipping SVN 1.7. Trying to `git svn dcommit` under the aforementioned
conditions yields the following error which aborts the commit process:

    Committing to http://example.com/svn ...
    perl: subversion/libsvn_subr/dirent_uri.c:1520: uri_skip_ancestor:
Assertion `svn_uri_is_canonical(child_uri, ((void *)0))' failed.
    error: git-svn died of signal 6

An analysis of the subversion source for the cause:

- The assertion originates from uri_skip_ancestor which calls
  svn_uri_is_canonical, which fails when the URL contains percent-encoded values
  that do not necessarily have to be encoded (not "canonical" enough). This is
  done by a table lookup in libsvn_subr/path.c. Putting some debugging prints
  revealed that the character ' is indeed encoded to %27 which is not
  considered canonical.
- url_skip_ancestor is called by svn_ra_neon__get_baseline_info with the root
  repository URL and path as parameters;
- which is called by copy_resource (libsvn_ra_neon/commit.c) for a copy action
  (or in my case, renaming which is actually copy + delete old);
- which is called by commit_add_dir;
- which is assigned as a structure method "add_file" in
  svn_ra_neon__get_commit_editor.

In the whole path, the path argument is not modified.

Through some more uninteresting wrapper functions, the Perl bindings gives you
access to the add_file method which will pass the path argument without
modifications to svn.

git-svn calls the "R"(ename) subroutine in Git::SVN::Editor which contains:
326         my $fbat = $self->add_file($self->repo_path($m->{file_b}), $pbat,
327                                 $self->url_path($m->{file_a}), $self->{r});
"repo_path" basically returns the path as-is, unless the "svn.pathnameencoding"
configuration property is set. "url_path" tries to escape some special
characters, but does not take all special characters into account, thereby
causing the path to contain some escaped characters which do not have to be
escaped.

The list of characters not to be escaped are taken from the
subversion/libsvn_subr/path.c file to fully account for all characters. Tested
with a filename containing all characters in the range 0x20 to 0x78 (inclusive).

Signed-off-by: Peter Wu <lekensteyn@gmail.com>
Signed-off-by: Eric Wong <normalperson@yhbt.net>