git.git
15 years agoMerge branch 'jl/clone-recurse-sm-synonym'
Junio C Hamano [Tue, 30 Nov 2010 01:52:34 +0000 (17:52 -0800)]
Merge branch 'jl/clone-recurse-sm-synonym'

* jl/clone-recurse-sm-synonym:
  clone: Add the --recurse-submodules option as alias for --recursive

15 years agoMerge branch 'jn/cherry-pick-refresh-index'
Junio C Hamano [Tue, 30 Nov 2010 01:52:34 +0000 (17:52 -0800)]
Merge branch 'jn/cherry-pick-refresh-index'

* jn/cherry-pick-refresh-index:
  cherry-pick/revert: transparently refresh index

15 years agoMerge branch 'jc/emfile'
Junio C Hamano [Tue, 30 Nov 2010 01:52:34 +0000 (17:52 -0800)]
Merge branch 'jc/emfile'

* jc/emfile:
  A loose object is not corrupt if it cannot be read due to EMFILE
  read_sha1_file(): report correct name of packfile with a corrupt object

15 years agoMerge branch 'md/interix'
Junio C Hamano [Tue, 30 Nov 2010 01:52:34 +0000 (17:52 -0800)]
Merge branch 'md/interix'

* md/interix:
  Interix: add configure checks
  add support for the SUA layer (interix; windows)

Conflicts:
git-compat-util.h

15 years agoMerge branch 'jl/add-p-reverse-message'
Junio C Hamano [Tue, 30 Nov 2010 01:52:34 +0000 (17:52 -0800)]
Merge branch 'jl/add-p-reverse-message'

* jl/add-p-reverse-message:
  Correct help blurb in checkout -p and friends

15 years agoMerge branch 'np/pack-broken-boundary'
Junio C Hamano [Tue, 30 Nov 2010 01:52:33 +0000 (17:52 -0800)]
Merge branch 'np/pack-broken-boundary'

* np/pack-broken-boundary:
  make pack-objects a bit more resilient to repo corruption

15 years agoMerge branch 'np/diff-in-corrupt-repository'
Junio C Hamano [Tue, 30 Nov 2010 01:52:33 +0000 (17:52 -0800)]
Merge branch 'np/diff-in-corrupt-repository'

* np/diff-in-corrupt-repository:
  diff: don't presume empty file when corresponding object is missing

15 years agoMerge branch 'fc/apply-p2-get-header-name'
Junio C Hamano [Tue, 30 Nov 2010 01:52:33 +0000 (17:52 -0800)]
Merge branch 'fc/apply-p2-get-header-name'

* fc/apply-p2-get-header-name:
  test: git-apply -p2 rename/chmod only
  Fix git-apply with -p greater than 1

15 years agoMerge branch 'jn/fast-import-fix'
Junio C Hamano [Tue, 30 Nov 2010 01:52:32 +0000 (17:52 -0800)]
Merge branch 'jn/fast-import-fix'

* jn/fast-import-fix:
  fast-import: do not clear notes in do_change_note_fanout()
  t9300 (fast-import): another test for the "replace root" feature
  fast-import: tighten M 040000 syntax
  fast-import: filemodify after M 040000 <tree> "" crashes

15 years agoMerge branch 'rr/needs-clean-work-tree'
Junio C Hamano [Tue, 30 Nov 2010 01:52:32 +0000 (17:52 -0800)]
Merge branch 'rr/needs-clean-work-tree'

* rr/needs-clean-work-tree:
  Porcelain scripts: Rewrite cryptic "needs update" error message

15 years agoMerge branch 'kb/blame-author-email'
Junio C Hamano [Tue, 30 Nov 2010 01:52:32 +0000 (17:52 -0800)]
Merge branch 'kb/blame-author-email'

* kb/blame-author-email:
  blame: Add option to show author email instead of name

Conflicts:
t/annotate-tests.sh

15 years agoMerge branch 'cm/diff-check-at-eol'
Junio C Hamano [Tue, 30 Nov 2010 01:52:31 +0000 (17:52 -0800)]
Merge branch 'cm/diff-check-at-eol'

* cm/diff-check-at-eol:
  diff --check: correct line numbers of new blank lines at EOF

15 years agoMerge branch 'ak/apply-non-git-epoch'
Junio C Hamano [Tue, 30 Nov 2010 01:52:31 +0000 (17:52 -0800)]
Merge branch 'ak/apply-non-git-epoch'

* ak/apply-non-git-epoch:
  apply: handle patches with funny filename and colon in timezone
  apply: Recognize epoch timestamps with : in the timezone

15 years agoMerge branch 'tc/smart-http-post-redirect'
Junio C Hamano [Tue, 30 Nov 2010 01:52:30 +0000 (17:52 -0800)]
Merge branch 'tc/smart-http-post-redirect'

* tc/smart-http-post-redirect:
  smart-http: Don't change POST to GET when following redirect

15 years agogitweb: document $per_request_config better
Jonathan Nieder [Mon, 29 Nov 2010 00:19:08 +0000 (18:19 -0600)]
gitweb: document $per_request_config better

Global variables $my_url, $my_uri and $base_url have subtle interactions
that need to be desribed, and can be influenced most cleanly by
$per_request_config.

Signed-off-by: Jonathan Nieder <redacted>
Acked-by: Jakub Narebski <redacted>
Signed-off-by: Junio C Hamano <redacted>
15 years agogitweb: selectable configurations that change with each request
Jakub Narebski [Thu, 25 Nov 2010 18:43:59 +0000 (19:43 +0100)]
gitweb: selectable configurations that change with each request

Allow selecting whether configuration file should be (re)parsed on each
request (the default, for backward compatibility with configurations that
change per session, see commit 7f425db (gitweb: allow configurations that
change with each request, 2010-07-30)), or whether should it be parsed only
once (for performance speedup for persistent environments, though currently
only FastCGI is able to make use of it, when flexibility is not important).

You can also have configuration file parsed only once, but have parts of
configuration (re)evaluated once per each request.

This is done by introducing $per_request_config variable: if set to code
reference, this code would be run once per request, while config file would
be parsed only once.  For example gitolite's contrib/gitweb/gitweb.conf
fragment mentioned in 7f425db could be rewritten as

  our $per_request_config = sub {
   $ENV{GL_USER} = ($cgi && $cgi->remote_user) || "gitweb";
  };

to make use of this feature.

If $per_request_config is not a code reference, it is taken to be boolean
variable, to choose between running config file for each request
(flexibility), and running config file only once (performance in
persistent environments).

The default value for $per_request_config is 1 (true), which means that
old configuration that require to change per session (like gitolite's)
will keep working.

While at it, make it so evaluate_git_version() is run only once.

Signed-off-by: Jakub Narebski <redacted>
Signed-off-by: Junio C Hamano <redacted>
15 years agocvsimport: partial whitespace cleanup
Michael J Gruber [Sun, 28 Nov 2010 19:39:45 +0000 (20:39 +0100)]
cvsimport: partial whitespace cleanup

in preparation of the config parse patch

Signed-off-by: Michael J Gruber <redacted>
Signed-off-by: Junio C Hamano <redacted>
15 years agodiff: add --detect-copies-harder as a synonym for --find-copies-harder
Kevin Ballard [Mon, 29 Nov 2010 22:52:59 +0000 (14:52 -0800)]
diff: add --detect-copies-harder as a synonym for --find-copies-harder

Signed-off-by: Kevin Ballard <redacted>
Signed-off-by: Junio C Hamano <redacted>
15 years agostatus: show branchname with a configurable color
Aleksi Aalto [Wed, 17 Nov 2010 23:40:05 +0000 (01:40 +0200)]
status: show branchname with a configurable color

You can tell "git status" to paint the name of the current branch in its
output (the line that says "On branch ...") by setting the configuration
variable color.status.branch; it is by default turned off.

Signed-off-by: Aleksi Aalto <redacted>
Signed-off-by: Junio C Hamano <redacted>
15 years agoUse reflog in 'pull --rebase . foo'
Martin von Zweigbergk [Sat, 13 Nov 2010 22:58:22 +0000 (23:58 +0100)]
Use reflog in 'pull --rebase . foo'

Since c85c792 (pull --rebase: be cleverer with rebased upstream
branches, 2008-01-26), "git pull --rebase" has used the reflog to try to
rebase from the old upstream onto the new upstream.

Make this work if the local repository is explicitly passed on the
command line as in 'git pull --rebase . foo'.

Signed-off-by: Martin von Zweigbergk <redacted>
Acked-by: Santi Béjar <redacted>
Signed-off-by: Junio C Hamano <redacted>
15 years agorebase: only show stat if configured to true
Martin von Zweigbergk [Tue, 9 Nov 2010 20:59:00 +0000 (21:59 +0100)]
rebase: only show stat if configured to true

If rebase.stat is set to true, a diffstat should be displayed. If it is
not set, it should default to false. However, if it is explicitly set to
false (or other value), a diffstat is still displayed, which is probably
not what most users would expect. Show diffstat only if it is set
to true.

Signed-off-by: Martin von Zweigbergk <redacted>
Signed-off-by: Junio C Hamano <redacted>
15 years agoentry.c: remove "checkout-index" from error messages
Nguyễn Thái Ngọc Duy [Sun, 28 Nov 2010 04:36:38 +0000 (11:36 +0700)]
entry.c: remove "checkout-index" from error messages

Back then when entry.c was part of checkout-index (or checkout-cache
at that time [1]). It makes sense to print the command name in error
messages. Nowadays entry.c is in libgit and can be used by any
commands, printing "git checkout-index: blah" does no more than
confusion. The error messages without it still give enough information.

[1] 12dccc1 (Make fiel checkout function available to the git library - 2005-06-05)

Signed-off-by: Nguyễn Thái Ngọc Duy <redacted>
Acked-by: Jeff King <redacted>
Signed-off-by: Junio C Hamano <redacted>
15 years agocommit: Add commit_list prefix in two function names.
Thiago Farina [Sat, 27 Nov 2010 01:58:14 +0000 (23:58 -0200)]
commit: Add commit_list prefix in two function names.

Add commit_list prefix to insert_by_date function and to sort_by_date,
so it's clear that these functions refer to commit_list structure.

Signed-off-by: Thiago Farina <redacted>
Signed-off-by: Junio C Hamano <redacted>
15 years agounpack-trees: move all skip-worktree checks back to unpack_trees()
Nguyễn Thái Ngọc Duy [Sat, 27 Nov 2010 06:24:04 +0000 (13:24 +0700)]
unpack-trees: move all skip-worktree checks back to unpack_trees()

Earlier, the will_have_skip_worktree() checks are done in various
places, which makes it hard to traverse the index tree-alike, required
by excluded_from_list(). This patch moves all the checks into two
loops in unpack_trees().

Entries in index in this operation can be classified into two
groups: ones already in index before unpack_trees() is called and ones
added to index after traverse_trees() is called.

In both groups, before checking file status on worktree, the future
skip-worktree bit must be checked, so that if an entry will be outside
worktree, worktree should not be checked.

For the first group, the future skip-worktree bit is precomputed and
stored as CE_NEW_SKIP_WORKTREE in the first loop before
traverse_trees() is called so that *way_merge() function does not need
to compute it again.

For the second group, because we don't know what entries will be in
this group until traverse_trees() finishes, operations that need
future skip-worktree check is delayed until CE_NEW_SKIP_WORKTREE is
computed in the second loop. CE_ADDED is used to mark entries in the
second group.

CE_ADDED and CE_NEW_SKIP_WORKTREE are temporary flags used in
unpack_trees().  CE_ADDED is only used by add_to_index(), which should
not be called while unpack_trees() is running.

Signed-off-by: Nguyễn Thái Ngọc Duy <redacted>
Signed-off-by: Junio C Hamano <redacted>
15 years agodir.c: add free_excludes()
Nguyễn Thái Ngọc Duy [Fri, 26 Nov 2010 18:17:44 +0000 (01:17 +0700)]
dir.c: add free_excludes()

Signed-off-by: Nguyễn Thái Ngọc Duy <redacted>
Signed-off-by: Junio C Hamano <redacted>
15 years agocache.h: realign and use (1 << x) form for CE_* constants
Nguyễn Thái Ngọc Duy [Sat, 27 Nov 2010 06:22:16 +0000 (13:22 +0700)]
cache.h: realign and use (1 << x) form for CE_* constants

Signed-off-by: Nguyễn Thái Ngọc Duy <redacted>
Signed-off-by: Junio C Hamano <redacted>
15 years agogit-rev-parse.txt: clarify --git-dir
Jonathan Nieder [Fri, 26 Nov 2010 15:32:31 +0000 (22:32 +0700)]
git-rev-parse.txt: clarify --git-dir

The current behavior is often to print an absolute path rather than
a ../../etc string, but callers must be ready to accept a relative
path, too. The most common output is ".git" (from the toplevel of
an ordinary work tree).

Signed-off-by: Jonathan Nieder <redacted>
Signed-off-by: Nguyễn Thái Ngọc Duy <redacted>
Signed-off-by: Junio C Hamano <redacted>
15 years agot1510: setup case #31
Nguyễn Thái Ngọc Duy [Fri, 26 Nov 2010 15:32:30 +0000 (22:32 +0700)]
t1510: setup case #31

Signed-off-by: Nguyễn Thái Ngọc Duy <redacted>
Signed-off-by: Junio C Hamano <redacted>
15 years agot1510: setup case #30
Nguyễn Thái Ngọc Duy [Fri, 26 Nov 2010 15:32:29 +0000 (22:32 +0700)]
t1510: setup case #30

Signed-off-by: Nguyễn Thái Ngọc Duy <redacted>
Signed-off-by: Junio C Hamano <redacted>
15 years agot1510: setup case #29
Nguyễn Thái Ngọc Duy [Fri, 26 Nov 2010 15:32:28 +0000 (22:32 +0700)]
t1510: setup case #29

Signed-off-by: Nguyễn Thái Ngọc Duy <redacted>
Signed-off-by: Junio C Hamano <redacted>
15 years agot1510: setup case #28
Nguyễn Thái Ngọc Duy [Fri, 26 Nov 2010 15:32:27 +0000 (22:32 +0700)]
t1510: setup case #28

Signed-off-by: Nguyễn Thái Ngọc Duy <redacted>
Signed-off-by: Junio C Hamano <redacted>
15 years agot1510: setup case #27
Nguyễn Thái Ngọc Duy [Fri, 26 Nov 2010 15:32:26 +0000 (22:32 +0700)]
t1510: setup case #27

Signed-off-by: Nguyễn Thái Ngọc Duy <redacted>
Signed-off-by: Junio C Hamano <redacted>
15 years agot1510: setup case #26
Nguyễn Thái Ngọc Duy [Fri, 26 Nov 2010 15:32:25 +0000 (22:32 +0700)]
t1510: setup case #26

Signed-off-by: Nguyễn Thái Ngọc Duy <redacted>
Signed-off-by: Junio C Hamano <redacted>
15 years agot1510: setup case #25
Nguyễn Thái Ngọc Duy [Fri, 26 Nov 2010 15:32:24 +0000 (22:32 +0700)]
t1510: setup case #25

Signed-off-by: Nguyễn Thái Ngọc Duy <redacted>
Signed-off-by: Junio C Hamano <redacted>
15 years agot1510: setup case #24
Nguyễn Thái Ngọc Duy [Fri, 26 Nov 2010 15:32:23 +0000 (22:32 +0700)]
t1510: setup case #24

Signed-off-by: Nguyễn Thái Ngọc Duy <redacted>
Signed-off-by: Junio C Hamano <redacted>
15 years agot1510: setup case #23
Nguyễn Thái Ngọc Duy [Fri, 26 Nov 2010 15:32:22 +0000 (22:32 +0700)]
t1510: setup case #23

Signed-off-by: Nguyễn Thái Ngọc Duy <redacted>
Signed-off-by: Junio C Hamano <redacted>
15 years agot1510: setup case #22
Nguyễn Thái Ngọc Duy [Fri, 26 Nov 2010 15:32:21 +0000 (22:32 +0700)]
t1510: setup case #22

Signed-off-by: Nguyễn Thái Ngọc Duy <redacted>
Signed-off-by: Junio C Hamano <redacted>
15 years agot1510: setup case #21
Nguyễn Thái Ngọc Duy [Fri, 26 Nov 2010 15:32:20 +0000 (22:32 +0700)]
t1510: setup case #21

Signed-off-by: Nguyễn Thái Ngọc Duy <redacted>
Signed-off-by: Junio C Hamano <redacted>
15 years agot1510: setup case #20
Nguyễn Thái Ngọc Duy [Fri, 26 Nov 2010 15:32:19 +0000 (22:32 +0700)]
t1510: setup case #20

Signed-off-by: Nguyễn Thái Ngọc Duy <redacted>
Signed-off-by: Junio C Hamano <redacted>
15 years agot1510: setup case #19
Nguyễn Thái Ngọc Duy [Fri, 26 Nov 2010 15:32:18 +0000 (22:32 +0700)]
t1510: setup case #19

Signed-off-by: Nguyễn Thái Ngọc Duy <redacted>
Signed-off-by: Junio C Hamano <redacted>
15 years agot1510: setup case #18
Nguyễn Thái Ngọc Duy [Fri, 26 Nov 2010 15:32:17 +0000 (22:32 +0700)]
t1510: setup case #18

Signed-off-by: Nguyễn Thái Ngọc Duy <redacted>
Signed-off-by: Junio C Hamano <redacted>
15 years agot1510: setup case #17
Nguyễn Thái Ngọc Duy [Fri, 26 Nov 2010 15:32:16 +0000 (22:32 +0700)]
t1510: setup case #17

Signed-off-by: Nguyễn Thái Ngọc Duy <redacted>
Signed-off-by: Junio C Hamano <redacted>
15 years agot1510: setup case #16
Nguyễn Thái Ngọc Duy [Fri, 26 Nov 2010 15:32:15 +0000 (22:32 +0700)]
t1510: setup case #16

Signed-off-by: Nguyễn Thái Ngọc Duy <redacted>
Signed-off-by: Junio C Hamano <redacted>
15 years agot1510: setup case #15
Nguyễn Thái Ngọc Duy [Fri, 26 Nov 2010 15:32:14 +0000 (22:32 +0700)]
t1510: setup case #15

Signed-off-by: Nguyễn Thái Ngọc Duy <redacted>
Signed-off-by: Junio C Hamano <redacted>
15 years agot1510: setup case #14
Nguyễn Thái Ngọc Duy [Fri, 26 Nov 2010 15:32:13 +0000 (22:32 +0700)]
t1510: setup case #14

Signed-off-by: Nguyễn Thái Ngọc Duy <redacted>
Signed-off-by: Junio C Hamano <redacted>
15 years agot1510: setup case #13
Nguyễn Thái Ngọc Duy [Fri, 26 Nov 2010 15:32:12 +0000 (22:32 +0700)]
t1510: setup case #13

Signed-off-by: Nguyễn Thái Ngọc Duy <redacted>
Signed-off-by: Junio C Hamano <redacted>
15 years agot1510: setup case #12
Nguyễn Thái Ngọc Duy [Fri, 26 Nov 2010 15:32:11 +0000 (22:32 +0700)]
t1510: setup case #12

Signed-off-by: Nguyễn Thái Ngọc Duy <redacted>
Signed-off-by: Junio C Hamano <redacted>
15 years agot1510: setup case #11
Nguyễn Thái Ngọc Duy [Fri, 26 Nov 2010 15:32:10 +0000 (22:32 +0700)]
t1510: setup case #11

Signed-off-by: Nguyễn Thái Ngọc Duy <redacted>
Signed-off-by: Junio C Hamano <redacted>
15 years agot1510: setup case #10
Nguyễn Thái Ngọc Duy [Fri, 26 Nov 2010 15:32:09 +0000 (22:32 +0700)]
t1510: setup case #10

Signed-off-by: Nguyễn Thái Ngọc Duy <redacted>
Signed-off-by: Junio C Hamano <redacted>
15 years agot1510: setup case #9
Nguyễn Thái Ngọc Duy [Fri, 26 Nov 2010 15:32:08 +0000 (22:32 +0700)]
t1510: setup case #9

Signed-off-by: Nguyễn Thái Ngọc Duy <redacted>
Signed-off-by: Junio C Hamano <redacted>
15 years agot1510: setup case #8
Nguyễn Thái Ngọc Duy [Fri, 26 Nov 2010 15:32:07 +0000 (22:32 +0700)]
t1510: setup case #8

Signed-off-by: Nguyễn Thái Ngọc Duy <redacted>
Signed-off-by: Junio C Hamano <redacted>
15 years agot1510: setup case #7
Nguyễn Thái Ngọc Duy [Fri, 26 Nov 2010 15:32:06 +0000 (22:32 +0700)]
t1510: setup case #7

Signed-off-by: Nguyễn Thái Ngọc Duy <redacted>
Signed-off-by: Junio C Hamano <redacted>
15 years agot1510: setup case #6
Nguyễn Thái Ngọc Duy [Fri, 26 Nov 2010 15:32:05 +0000 (22:32 +0700)]
t1510: setup case #6

Signed-off-by: Nguyễn Thái Ngọc Duy <redacted>
Signed-off-by: Junio C Hamano <redacted>
15 years agot1510: setup case #5
Nguyễn Thái Ngọc Duy [Fri, 26 Nov 2010 15:32:04 +0000 (22:32 +0700)]
t1510: setup case #5

Signed-off-by: Nguyễn Thái Ngọc Duy <redacted>
Signed-off-by: Junio C Hamano <redacted>
15 years agot1510: setup case #4
Nguyễn Thái Ngọc Duy [Fri, 26 Nov 2010 15:32:03 +0000 (22:32 +0700)]
t1510: setup case #4

Signed-off-by: Nguyễn Thái Ngọc Duy <redacted>
Signed-off-by: Junio C Hamano <redacted>
15 years agot1510: setup case #3
Nguyễn Thái Ngọc Duy [Fri, 26 Nov 2010 15:32:02 +0000 (22:32 +0700)]
t1510: setup case #3

Signed-off-by: Nguyễn Thái Ngọc Duy <redacted>
Signed-off-by: Junio C Hamano <redacted>
15 years agot1510: setup case #2
Nguyễn Thái Ngọc Duy [Fri, 26 Nov 2010 15:32:01 +0000 (22:32 +0700)]
t1510: setup case #2

Signed-off-by: Nguyễn Thái Ngọc Duy <redacted>
Signed-off-by: Junio C Hamano <redacted>
15 years agot1510: setup case #1
Nguyễn Thái Ngọc Duy [Fri, 26 Nov 2010 15:32:00 +0000 (22:32 +0700)]
t1510: setup case #1

Signed-off-by: Nguyễn Thái Ngọc Duy <redacted>
Signed-off-by: Junio C Hamano <redacted>
15 years agot1510: setup case #0
Nguyễn Thái Ngọc Duy [Fri, 26 Nov 2010 15:31:59 +0000 (22:31 +0700)]
t1510: setup case #0

Signed-off-by: Nguyễn Thái Ngọc Duy <redacted>
Signed-off-by: Junio C Hamano <redacted>
15 years agoAdd t1510 and basic rules that run repo setup
Nguyễn Thái Ngọc Duy [Fri, 26 Nov 2010 15:31:58 +0000 (22:31 +0700)]
Add t1510 and basic rules that run repo setup

Signed-off-by: Nguyễn Thái Ngọc Duy <redacted>
Signed-off-by: Junio C Hamano <redacted>
15 years agobuiltins: print setup info if repo is found
Nguyễn Thái Ngọc Duy [Fri, 26 Nov 2010 15:31:57 +0000 (22:31 +0700)]
builtins: print setup info if repo is found

Signed-off-by: Nguyễn Thái Ngọc Duy <redacted>
Signed-off-by: Junio C Hamano <redacted>
15 years agohttp-fetch: rework url handling
Tay Ray Chuan [Thu, 25 Nov 2010 08:21:10 +0000 (16:21 +0800)]
http-fetch: rework url handling

Do away with a second url variable, rewritten_url, and make url
non-const. This is safe because the functions called with url (ie.
get_http_walker() and walker_fetch()) do not modify it (ie. marked with
const char *).

Also, replace code that adds a trailing slash with a call to
str_end_url_with_slash().

Signed-off-by: Tay Ray Chuan <redacted>
Signed-off-by: Junio C Hamano <redacted>
15 years agohttp-push: add trailing slash at arg-parse time, instead of later on
Tay Ray Chuan [Thu, 25 Nov 2010 08:21:09 +0000 (16:21 +0800)]
http-push: add trailing slash at arg-parse time, instead of later on

That way, we don't have to update repo->path and repo->path_len again
after adding the trailing slash.

Signed-off-by: Tay Ray Chuan <redacted>
Signed-off-by: Junio C Hamano <redacted>
15 years agohttp-push: check path length before using it
Tay Ray Chuan [Thu, 25 Nov 2010 08:21:08 +0000 (16:21 +0800)]
http-push: check path length before using it

We use path_len to skip the base url/path, but we do not know for sure
if path does indeed contain the base url/path. Check if this is so.

Helped-by: Johnathan Nieder <redacted>
Signed-off-by: Tay Ray Chuan <redacted>
Signed-off-by: Junio C Hamano <redacted>
15 years agohttp-push: Normalise directory names when pushing to some WebDAV servers
Tay Ray Chuan [Thu, 25 Nov 2010 08:21:07 +0000 (16:21 +0800)]
http-push: Normalise directory names when pushing to some WebDAV servers

Fix a bug when pushing to WebDAV servers which do not use a trailing
slash for collection names. The previous implementation fails to see
that the requested resource "refs/" is the same resource as "refs"
and loads every reference twice (once for refs/ and once for refs).

This implementation normalises every collection name by appending a
trailing slash if necessary.

This can be tested with old versions of Apache (such as the WebDAV
server of GMX, Apache 2.0.63).

Based-on-patch-by: Gabriel Corona <redacted>
Signed-off-by: Tay Ray Chuan <redacted>
Signed-off-by: Junio C Hamano <redacted>
15 years agohttp-backend: use end_url_with_slash()
Tay Ray Chuan [Thu, 25 Nov 2010 08:21:06 +0000 (16:21 +0800)]
http-backend: use end_url_with_slash()

Signed-off-by: Tay Ray Chuan <redacted>
Signed-off-by: Junio C Hamano <redacted>
15 years agourl: add str wrapper for end_url_with_slash()
Tay Ray Chuan [Thu, 25 Nov 2010 08:21:05 +0000 (16:21 +0800)]
url: add str wrapper for end_url_with_slash()

Helped-by: Johnathan Nieder <redacted>
Signed-off-by: Tay Ray Chuan <redacted>
Signed-off-by: Junio C Hamano <redacted>
15 years agoshift end_url_with_slash() from http.[ch] to url.[ch]
Tay Ray Chuan [Thu, 25 Nov 2010 08:21:04 +0000 (16:21 +0800)]
shift end_url_with_slash() from http.[ch] to url.[ch]

This allows non-http/curl users to access it too (eg. http-backend.c).

Update include headers in end_url_with_slash() users too.

Signed-off-by: Tay Ray Chuan <redacted>
Signed-off-by: Junio C Hamano <redacted>
15 years agot5550-http-fetch: add test for http-fetch
Tay Ray Chuan [Thu, 25 Nov 2010 08:21:03 +0000 (16:21 +0800)]
t5550-http-fetch: add test for http-fetch

Signed-off-by: Tay Ray Chuan <redacted>
Signed-off-by: Junio C Hamano <redacted>
15 years agot5550-http-fetch: add missing '&&'
Tay Ray Chuan [Thu, 25 Nov 2010 08:21:02 +0000 (16:21 +0800)]
t5550-http-fetch: add missing '&&'

Signed-off-by: Tay Ray Chuan <redacted>
Signed-off-by: Junio C Hamano <redacted>
15 years agoMerge branch 'en/and-cascade-tests'
Junio C Hamano [Fri, 26 Nov 2010 22:45:37 +0000 (14:45 -0800)]
Merge branch 'en/and-cascade-tests'

* en/and-cascade-tests:
  t7300: add a missing SYMLINKS prerequisite

15 years agot7300: add a missing SYMLINKS prerequisite
Johannes Sixt [Thu, 25 Nov 2010 08:03:39 +0000 (09:03 +0100)]
t7300: add a missing SYMLINKS prerequisite

The test fails on Windows since 2dec68c (tests: add missing &&, batch 2).

Even though this test allocates and leaves behind files, subsequent tests
do not depend on this, so it is safe to just skip it.

Signed-off-by: Johannes Sixt <redacted>
Signed-off-by: Junio C Hamano <redacted>
15 years agoMerge branch 'cb/maint-orphan-merge-noclobber'
Junio C Hamano [Wed, 24 Nov 2010 23:55:36 +0000 (15:55 -0800)]
Merge branch 'cb/maint-orphan-merge-noclobber'

* cb/maint-orphan-merge-noclobber:
  do not overwrite untracked during merge from unborn branch

15 years agoMerge branch 'ao/send-email-irt'
Junio C Hamano [Wed, 24 Nov 2010 23:55:32 +0000 (15:55 -0800)]
Merge branch 'ao/send-email-irt'

* ao/send-email-irt:
  git-send-email.perl: make initial In-Reply-To apply only to first email
  t9001: send-email interation with --in-reply-to and --chain-reply-to

15 years agoMerge branch 'jk/add-e-doc'
Junio C Hamano [Wed, 24 Nov 2010 23:55:29 +0000 (15:55 -0800)]
Merge branch 'jk/add-e-doc'

* jk/add-e-doc:
  docs: give more hints about how "add -e" works
  docs: give more hints about how "add -e" works

15 years agoMerge branch 'rs/opt-help-text'
Junio C Hamano [Wed, 24 Nov 2010 23:55:19 +0000 (15:55 -0800)]
Merge branch 'rs/opt-help-text'

* rs/opt-help-text:
  verify-tag: document --verbose
  branch: improve --verbose description
  archive: improve --verbose description
  Describe various forms of "be quiet" using OPT__QUIET
  add OPT__FORCE
  add description parameter to OPT__QUIET
  add description parameter to OPT__DRY_RUN
  add description parameter to OPT__VERBOSE

15 years agoMerge branch 'kb/maint-rebase-autosquash'
Junio C Hamano [Wed, 24 Nov 2010 23:55:15 +0000 (15:55 -0800)]
Merge branch 'kb/maint-rebase-autosquash'

* kb/maint-rebase-autosquash:
  rebase: teach --autosquash to match on sha1 in addition to message
  rebase: better rearranging of fixup!/squash! lines with --autosquash

15 years agoMerge branch 'mm/phrase-remote-tracking'
Junio C Hamano [Wed, 24 Nov 2010 23:55:05 +0000 (15:55 -0800)]
Merge branch 'mm/phrase-remote-tracking'

* mm/phrase-remote-tracking:
  git-branch.txt: mention --set-upstream as a way to change upstream configuration
  user-manual: remote-tracking can be checked out, with detached HEAD
  user-manual.txt: explain better the remote(-tracking) branch terms
  Change incorrect "remote branch" to "remote tracking branch" in C code
  Change incorrect uses of "remote branch" meaning "remote-tracking"
  Change "tracking branch" to "remote-tracking branch"
  everyday.txt: change "tracking branch" to "remote-tracking branch"
  Change remote tracking to remote-tracking in non-trivial places
  Replace "remote tracking" with "remote-tracking"
  Better "Changed but not updated" message in git-status

15 years agoMerge branch 'en/and-cascade-tests'
Junio C Hamano [Wed, 24 Nov 2010 23:51:49 +0000 (15:51 -0800)]
Merge branch 'en/and-cascade-tests'

* en/and-cascade-tests: (25 commits)
  t4124 (apply --whitespace): use test_might_fail
  t3404: do not use 'describe' to implement test_cmp_rev
  t3404 (rebase -i): introduce helper to check position of HEAD
  t3404 (rebase -i): move comment to description
  t3404 (rebase -i): unroll test_commit loops
  t3301 (notes): use test_expect_code for clarity
  t1400 (update-ref): use test_must_fail
  t1502 (rev-parse --parseopt): test exit code from "-h"
  t6022 (renaming merge): chain test commands with &&
  test-lib: introduce test_line_count to measure files
  tests: add missing &&, batch 2
  tests: add missing &&
  Introduce sane_unset and use it to ensure proper && chaining
  t7800 (difftool): add missing &&
  t7601 (merge-pull-config): add missing &&
  t7001 (mv): add missing &&
  t6016 (rev-list-graph-simplify-history): add missing &&
  t5602 (clone-remote-exec): add missing &&
  t4026 (color): remove unneeded and unchained command
  t4019 (diff-wserror): add lots of missing &&
  ...

Conflicts:
t/t7006-pager.sh

15 years agodocs: default to more modern toolset
Jeff King [Fri, 19 Nov 2010 17:54:24 +0000 (12:54 -0500)]
docs: default to more modern toolset

When the ASCIIDOC8 and ASCIIDOC_NO_ROFF knobs were built,
many people were still on asciidoc 7 and using older
versions of docbook-xsl. These days, even the almost
2-year-old Debian stable needs these knobs turned.

So let's turn them by default. The new knobs ASCIIDOC7 and
ASCIIDOC_ROFF can be used to get the old behavior if people
are on older systems.

Signed-off-by: Jeff King <redacted>
Signed-off-by: Junio C Hamano <redacted>
15 years agofast-import: treat SIGUSR1 as a request to access objects early
Jonathan Nieder [Mon, 22 Nov 2010 08:16:02 +0000 (02:16 -0600)]
fast-import: treat SIGUSR1 as a request to access objects early

It can be tedious to wait for a multi-million-revision import.
Unfortunately it is hard to spy on the import because fast-import
works by continuously streaming out objects, without updating the pack
index or refs until a checkpoint command or the end of the stream.

So allow the impatient operator to request checkpoints by sending a
signal, like so:

killall -USR1 git-fast-import

When receiving such a signal, fast-import would schedule a checkpoint
to take place after the current top-level command (usually a "commit"
or "blob" request) finishes.

Caveats: just like ordinary checkpoint commands, such requests slow
down the import.  Switching to a new pack at a suboptimal moment is
also likely to result in a less dense initial collection of packs.
That's the price.

Signed-off-by: Jonathan Nieder <redacted>
Signed-off-by: Junio C Hamano <redacted>
15 years agovcs-svn: Implement Prop-delta handling
David Barr [Sat, 20 Nov 2010 00:57:46 +0000 (18:57 -0600)]
vcs-svn: Implement Prop-delta handling

The rules for what file is used as delta source for each file are not
documented in dump-load-format.txt.  Luckily, the Apache Software
Foundation repository has rich enough examples to figure out most of
the rules:

Node-action: replace implies the empty property set and empty text as
preimage for deltas.  Otherwise, if a copyfrom source is given, that
node is the preimage for deltas.  Lastly, if none of the above applies
and the node path exists in the current revision, then that version
forms the basis.

[jn: refactored, with tests]

Signed-off-by: David Barr <redacted>
Signed-off-by: Jonathan Nieder <redacted>
Signed-off-by: Junio C Hamano <redacted>
15 years agovcs-svn: Sharpen parsing of property lines
Jonathan Nieder [Sat, 20 Nov 2010 00:54:45 +0000 (18:54 -0600)]
vcs-svn: Sharpen parsing of property lines

Prepare to add a new type of property line (the 'D' line) to
handle property deltas.

Signed-off-by: Jonathan Nieder <redacted>
Signed-off-by: Junio C Hamano <redacted>
15 years agovcs-svn: Split off function for handling of individual properties
Jonathan Nieder [Sat, 20 Nov 2010 00:54:20 +0000 (18:54 -0600)]
vcs-svn: Split off function for handling of individual properties

The handle_property function is the part of read_props that would be
interesting for most people: semantics of properties rather than the
algorithm for parsing them.

Signed-off-by: Jonathan Nieder <redacted>
Signed-off-by: Junio C Hamano <redacted>
15 years agovcs-svn: Make source easier to read on small screens
Jonathan Nieder [Sat, 20 Nov 2010 00:53:54 +0000 (18:53 -0600)]
vcs-svn: Make source easier to read on small screens

Remove some newlines from handle_node() that are not needed for
clarity.

Signed-off-by: Jonathan Nieder <redacted>
Signed-off-by: Junio C Hamano <redacted>
15 years agovcs-svn: More dump format sanity checks
Jonathan Nieder [Sat, 20 Nov 2010 00:53:34 +0000 (18:53 -0600)]
vcs-svn: More dump format sanity checks

Node-action: change is not appropriate when switching between file and
directory or adding a new file.  Current svn-fe silently accepts such
nodes and the resulting tree has missing files in the "changed when
meant to add" case.

Node-action: add requires some content (text or directory); there is
no such thing as an "intent to add" node in svn dumps.  Current svn-fe
accepts such contentless adds but produces an invalid fast-import
stream that refers to nonexistent mark :0 in response.

Signed-off-by: Jonathan Nieder <redacted>
Signed-off-by: Junio C Hamano <redacted>
15 years agovcs-svn: Reject path nodes without Node-action
Jonathan Nieder [Sat, 20 Nov 2010 00:52:59 +0000 (18:52 -0600)]
vcs-svn: Reject path nodes without Node-action

It would be better to flag such errors and let the import proceed
anyway, but for now it is simpler not to worry about recovery
from such weird cases.

Signed-off-by: Jonathan Nieder <redacted>
Signed-off-by: Junio C Hamano <redacted>
15 years agovcs-svn: Delay read of per-path properties
Jonathan Nieder [Sat, 20 Nov 2010 00:52:28 +0000 (18:52 -0600)]
vcs-svn: Delay read of per-path properties

The mode for each file in an svn-format dump is kept in the properties
section.  The properties section is read as soon as possible to allow
the correct mode to be filled in when registering the file with the
repo_tree lib.

To support nodes with a missing properties section, svn-fe determines
the mode in three stages:

 - The kind (directory or file) of the node is read from the dump and
   used to make an initial estimate (040000 or 100644).
 - Properties are read in and allowed to override this for symlinks
   and executables.
 - If there is no properties section, the mode from the previous
   content of the path is left alone, overriding the above
   considerations.

This is a bit of a mess, and worse, it would get even more complicated
once we start to support property deltas.  If we could only register
the file with a provisional value for mode and then change it later
when properties say so, the procedure would be much simpler.

... oh, right, we can.

Signed-off-by: Jonathan Nieder <redacted>
Signed-off-by: Junio C Hamano <redacted>
15 years agovcs-svn: Combine repo_replace and repo_modify functions
Jonathan Nieder [Sat, 20 Nov 2010 00:51:50 +0000 (18:51 -0600)]
vcs-svn: Combine repo_replace and repo_modify functions

There are two functions to change the staged content for a path in the
svn importer's active commit: repo_replace, which changes the text and
returns the mode, and repo_modify, which changes the text and mode and
returns nothing.

Worse, there are more subtle differences:

 - A mark of 0 passed to repo_modify means "use the existing content".
   repo_replace uses it as mark :0 and produces a corrupt stream.

 - When passed a path that is not part of the active commit,
   repo_replace returns without doing anything.  repo_modify
   transparently adds a new directory entry.

Get rid of both and introduce a new function with the best features of
both: repo_modify_path modifies the mode, content, or both for a path,
depending on which arguments are zero.  If no such dirent already
exists, it does nothing and reports the error by returning 0.
Otherwise, the return value is the resulting mode.

Signed-off-by: Jonathan Nieder <redacted>
Signed-off-by: Junio C Hamano <redacted>
15 years agovcs-svn: Replace = Delete + Add
Jonathan Nieder [Sat, 20 Nov 2010 00:49:55 +0000 (18:49 -0600)]
vcs-svn: Replace = Delete + Add

Simplify by reducing the "Node-action: replace" case to "Node-action:
add".  This way, the main part of handle_node() only has to deal with
"add" and "change" nodes.

Functional change: replacing a symlink or executable without setting
properties will reset the mode.

Signed-off-by: Jonathan Nieder <redacted>
Signed-off-by: Junio C Hamano <redacted>
15 years agovcs-svn: handle_node: Handle deletion case early
Jonathan Nieder [Sat, 20 Nov 2010 00:49:17 +0000 (18:49 -0600)]
vcs-svn: handle_node: Handle deletion case early

Take care of "Node-action: delete" as soon as possible, so we can stop
worrying about that case in the rest of the function.

Functional change: catch deletion nodes with features that would not
apply to them (text, properties, or origin data) and error out for
those cases.

Signed-off-by: Jonathan Nieder <redacted>
Signed-off-by: Junio C Hamano <redacted>
15 years agovcs-svn: Use mark to indicate nodes with included text
Jonathan Nieder [Sat, 20 Nov 2010 00:48:51 +0000 (18:48 -0600)]
vcs-svn: Use mark to indicate nodes with included text

Allocate a mark if needed as soon as possible so later code can use
"if (mark)" to check if this node has text attached rather than
explicitly checking for Text-content-length.

While at it, reject directory nodes with text attached; the presence
of such a node would indicate a bug in the dump generator or svn-fe's
understanding.  In the long term, it would be nice to be able to
continue parsing and save the error for later, but for now it is
simpler to error out right away.

Signed-off-by: Jonathan Nieder <redacted>
Signed-off-by: Junio C Hamano <redacted>
15 years agovcs-svn: Unclutter handle_node by introducing have_props var
Jonathan Nieder [Sat, 20 Nov 2010 00:47:41 +0000 (18:47 -0600)]
vcs-svn: Unclutter handle_node by introducing have_props var

It is possible for a path node in an SVN-format dump file to leave out
the properties section.  svn-fe handles this by carrying over the
properties (in particular, file type) from the old version of that
node.

To support this, handle_node tests several times whether a
Prop-content-length field is present.  Ancient Subversion actually
leaves out the Prop-content-length field even for nodes with
properties, so that's not quite the right check.  Besides, this detail
of mechanism is distracting when the question at hand is instead what
content the new node should have.

So introduce a local have_props variable.  The semantics are the same
as before; the adaptations to support ancient streams that leave out
the prop-content-length can wait until someone needs them.

Signed-off-by: Jonathan Nieder <redacted>
Signed-off-by: Junio C Hamano <redacted>
15 years agovcs-svn: Eliminate node_ctx.mark global
Jonathan Nieder [Sat, 20 Nov 2010 00:46:54 +0000 (18:46 -0600)]
vcs-svn: Eliminate node_ctx.mark global

The mark variable is only used in handle_node().  Its life is
very short and simple: first, a new mark number is allocated if
this node has text attached, then that mark is recorded in the
in-core tree being built up, and lastly the mark is communicated
to fast-import in the stream along with the associated text.

A new reader may worry about interaction with other code, especially
since mark is not initialized to zero in handle_node() itself.
Disperse such worries by making it local.  No functional change
intended.

Signed-off-by: Jonathan Nieder <redacted>
Signed-off-by: Junio C Hamano <redacted>
15 years agovcs-svn: Eliminate node_ctx.srcRev global
Jonathan Nieder [Sat, 20 Nov 2010 00:46:22 +0000 (18:46 -0600)]
vcs-svn: Eliminate node_ctx.srcRev global

The srcRev variable is only used in handle_node(); its purpose
is to hold the old mode for a path, to only be used if properties
are not being changed.  Narrow its scope to make its meaningful
lifetime more obvious.

No functional change intended.  Add some tests as a sanity-check
for the simplest case (no renames).

Signed-off-by: Jonathan Nieder <redacted>
Signed-off-by: Junio C Hamano <redacted>
15 years agovcs-svn: Check for errors from open()
Jonathan Nieder [Sat, 20 Nov 2010 00:46:06 +0000 (18:46 -0600)]
vcs-svn: Check for errors from open()

test-svn-fe segfaults when passed a bogus path.  Simplify debugging by
exiting with a meaningful error message instead.

Signed-off-by: Jonathan Nieder <redacted>
Signed-off-by: Junio C Hamano <redacted>
15 years agovcs-svn: Allow simple v3 dumps (no deltas yet)
David Barr [Thu, 18 Nov 2010 05:03:51 +0000 (23:03 -0600)]
vcs-svn: Allow simple v3 dumps (no deltas yet)

Since the dumpfile version 1 days, the Subversion dump format
gained some new fields:

 - a unique identifier for the repository (version 2 format)
 - whether the text and properties for a node should be
   interpreted as deltas
 - checksums for a delta's preimage
 - SHA-1 sums as alternatives to the existing MD5 checksums for
   copy source and the payload (delta).

For now what is relevant to us is the Text-delta and Prop-delta
fields, since not noticing these causes a dump file to be
misinterpreted (see the previous commit).

[jn: with tests]

Signed-off-by: David Barr <redacted>
Signed-off-by: Jonathan Nieder <redacted>
Signed-off-by: Junio C Hamano <redacted>
15 years agovcs-svn: Error out for v3 dumps
Jonathan Nieder [Thu, 18 Nov 2010 05:02:48 +0000 (23:02 -0600)]
vcs-svn: Error out for v3 dumps

By ignoring the Text-Delta and Prop-Delta node fields, current svn-fe
happily mistakes deltas for full text and instead of cleanly erroring
out, it produces a valid but semantically bogus fast-import stream
when fed a dump file in the modern "svnadmin dump --deltas" format.

Dump file parsers are supposed to ignore header fields they don't
understand (to allow for backward-compatible extensions), but they are
also supposed to check the SVN-fs-dump-format-version header to
prevent misinterpretation of non backward-compatible extensions.
Do so.

Signed-off-by: Jonathan Nieder <redacted>
Signed-off-by: Junio C Hamano <redacted>
15 years agoMerge branch 'maint'
Junio C Hamano [Wed, 24 Nov 2010 21:24:49 +0000 (13:24 -0800)]
Merge branch 'maint'

* maint:
  imap-send: link against libcrypto for HMAC and others
  git-send-email.perl: Deduplicate "to:" and "cc:" entries with names
  mingw: do not set errno to 0 on success

15 years agoMerge branch 'jl/maint-pull-tags-doc' into maint
Junio C Hamano [Wed, 24 Nov 2010 20:47:42 +0000 (12:47 -0800)]
Merge branch 'jl/maint-pull-tags-doc' into maint

* jl/maint-pull-tags-doc:
  pull: Remove --tags option from manpage

git clone https://git.99rst.org/PROJECT