Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

l10n: Initial Portuguese Portugal (pt_PT) language #9

Closed
wants to merge 273 commits into from

Showing 273 unique commits by 39 authors.

This pull request is big! We're only showing the most recent 250 commits.
Apr 26, 2009
apenwarr Add some basic assertions to test.sh. 1490e15
apenwarr test.sh tweak a046c7b
apenwarr Trim some extra merge commits that don't need to go into the split tree.
...and update test.sh to test for this.
a64f3a7
apenwarr Only copy a commit if it has at least one nonidentical parent.
This is a simplification of the previous logic.  I don't *think* it'll break
anything.

Results in far fewer useless merge commmits when playing with gitweb in the
git project:

git subtree split --prefix=gitweb --annotate='(split) ' 0a8f4f0^^..f2e7330
	--onto=1130ef3

...and it doesn't *seem* to eliminate anything important.
49cf822
apenwarr test.sh: make sure no commit changes more than one file at a time. fa16ab3
apenwarr Simplify merges even more aggressively.
If any one of the parents is the same as the current one, then clearly the
other parent branch isn't important, so throw it away entirely.

Can't remember why I didn't do this before, but if I rediscover it, it
definitely needs a unit test.
795e730
apenwarr test.sh: oops, never intended to count the raw number of commits.
Just needed to make sure the count was non-zero.
34a82bd
apenwarr debug messages are off by default; use -d to enable.
Instead of debug messages, we print a progress counter to stderr.
942dce5
Apr 30, 2009
apenwarr Abort if --rejoin fails.
Thanks to Eduardo Kienetz for noticing this.
ea28d67
May 24, 2009
apenwarr More to-do items based on feedback 7b7ba4b
May 30, 2009
apenwarr typo in comment f96bc79
apenwarr New --branch option to split command.
This is just a handy way to create a new branch from the newly-split subtree.
43a3951
apenwarr slightly rearrange help message for split. f4f2955
apenwarr FIXME help for --squash option 8e79043
apenwarr merge_msg() is really more like rejoin_msg(). 7ee9eef
apenwarr Basic "subtree merge --squash" support.
Instead of merging in the history of the entire subproject, just squash it
all into one commit, but try to at least track which commits we used so that
we can do future merges correctly.

Bonus feature: we can actually switch branches of the subproject this way,
just by "squash merging" back and forth from one tag to another.
1cc2cff
apenwarr Don't squash-merge if the old and new commits are the same. eb4fb91
apenwarr Fix splitting after using a squash merge. 1a8c36d
apenwarr Make --squash work with the 'add' command too. d713e2d
apenwarr Add basic git-subtree manpage in asciidoc format. e75d1da
apenwarr man page: add an EXAMPLES section. dd07906
Jun 15, 2009
apenwarr update todo c8a98d4
Jul 02, 2009
apenwarr Some todo items reported by pmccurdy 6aa7626
Jul 07, 2009
apenwarr todo 76a7356
Jul 08, 2009
apenwarr Docs: when pushing to github, the repo path needs to end in .git
Reported by Thell Fowler.
b64a7aa
Jul 10, 2009
apenwarr todo 5d1a5da
Jul 16, 2009
apenwarr todo^ 344f58a
Aug 01, 2009
apenwarr todo 0af6aa4
Aug 02, 2009
apenwarr todo: idea for a 'git subtree grafts' command ef75966
Aug 12, 2009
Amiel Martin fixed order of assertion in tests e1a5b9d
Amiel Martin sort assertion to make it more generic 558e7a5
Aug 20, 2009
Gianluca Pacchiella Add explicit path of git installation by 'git --exec-path'.
As pointed out by documentation, the correct use of 'git-sh-setup' is
using $(git --exec-path) to avoid problems with not standard
installations.

Signed-off-by: gianluca.pacchiella <pacchiel@studenti.ph.unito.it>
2987e6a
Aug 26, 2009
apenwarr Improve patch to use git --exec-path: add to PATH instead.
If you (like me) are using a modified git straight out of its source
directory (ie. without installing), then --exec-path isn't actually correct.
Add it to the PATH instead, so if it is correct, it'll work, but if it's
not, we fall back to the previous behaviour.
33aaa69
apenwarr Fix behaviour if you have a branch named the same as your --prefix
We were trying to 'git checkout $prefix', which is ambiguous if $prefix
names a directory *and* a branch.  Do 'git checkout -- $prefix' instead.

The main place this appeared was in 'git subtree add'.

Reported by several people.
227f781
Sep 30, 2009
Pelle Wessman Check that the type of the tree really is a tree and not a commit as …
…it seems to sometimes become when eg. a submodule has existed in the same position previously.
8ac5eca
Oct 02, 2009
apenwarr Add a README that says to email me instead of using github mail.
What's with this new generation who hates email so much?
add00a3
apenwarr Merge branch 'master' of git://github.com/voxpelli/git-subtree
* 'master' of git://github.com/voxpelli/git-subtree:
  Check that the type of the tree really is a tree and not a commit as it seems to sometimes become when eg. a submodule has existed in the same position previously.
39ee6ec
apenwarr If someone provides a --prefix that ends with slash, strip the slash.
Prefixes that differ only in the trailing slash should be considered
identical.

Also update the test to check that this works.
6f2012c
apenwarr Fix a minor problem in identifying squashes vs. normal splits.
This didn't seem to have any noticeable side effects other than
suspicious-looking log messages when you used -d.
2275f70
apenwarr cmd_pull didn't support --squash correctly.
We should implement it as
	git fetch ...
	git subtree merge ...

But we were instead just calling
	git pull -s subtree ...

because 'git subtree merge' used to be just an alias for 'git merge -s
subtree', but it no longer is.
e31d1e2
Nov 04, 2009
apenwarr Add some tips for how to install. c567d9e
Nov 15, 2009
apenwarr Oops, forgot a COPYING file. It's GPLv2.
Thanks to Ben Walton for pointing this out.
d8b2c0d
add installation support to Makefile
Signed-off-by: Ben Walton <bwalton@artsci.utoronto.ca>
0d31de3
make git version dynamic when building documentation
Signed-off-by: Ben Walton <bwalton@artsci.utoronto.ca>
d20ac24
Nov 20, 2009
apenwarr Weird, I forgot to have 'make test' call test.sh. d344532
Jan 06, 2010
Jakub Suder added -p alias for --prefix 6da4013
Jan 10, 2010
Jakub Suder added -m/--message option for setting merge commit message 2da0969
Jakub Suder allow using --branch with existing branches if it makes sense 0a56294
Jakub Suder fix for subtree split not finding proper base for new commits da949cc
Jan 12, 2010
Jakub Suder changed alias for --prefix from -p to -P 6e25f79
Jakub Suder fixed bug in commit message for split 1262916
Jakub Suder added tests for recent changes 13ea2b5
Jakub Suder added temporary test dirs to gitignore 4a6ea5c
Jakub Suder improved rev_is_descendant_of_branch() function 6bd910a
Feb 02, 2010
Yuki Izumi Fix refspecs in given example for git subtree pull.
(Updated slightly by apenwarr)
e1ce417
apenwarr Merge branch 'master' of git://github.com/psionides/git-subtree
* 'master' of git://github.com/psionides/git-subtree:
  improved rev_is_descendant_of_branch() function
  added temporary test dirs to gitignore
  added tests for recent changes
  fixed bug in commit message for split
  changed alias for --prefix from -p to -P
  fix for subtree split not finding proper base for new commits
  allow using --branch with existing branches if it makes sense
  added -m/--message option for setting merge commit message
  added -p alias for --prefix
b2f166e
apenwarr Jakub's changes broke the progress message slightly.
We really need that ^M (\r), not a ^J (\n) if we want the status message to
overwrite itself nicely.
e2d0a45
Feb 05, 2010
Win Treese git-subtree.txt: add another example. 37668a1
Feb 06, 2010
Win Treese Make sure that <prefix> exists when splitting.
And test cases for that check, as well as for an error if no prefix is
specified at all.
ec54f0d
apenwarr Make tests pass with recent git (1.7.0 and up).
It seems that in older versions, --message="" was interpreted as "use the
default commit message" instead of "use an empty commit message", and
git-subtree was depending on this behaviour.  Now we don't, so tests pass
again.
349a70d
Feb 08, 2010
apenwarr Improve checking for existence of the --prefix directory.
For add, the prefix must *not* already exist.  For all the other commands,
it *must* already exist.
77ba305
apenwarr Oops. Apparently I didn't run 'make test' after most recent change.
Thanks to Dan Sabath for pointing that out.
00889c8
apenwarr Some recent tests accidentally depended on very new versions of git.
The "--format" option is too new.  Use "--pretty=format:" (which means the
same thing) instead.  Now it works again on git 1.6.0 (at least).
6fe9863
kiyose docs: add simple 'add' case to clarify setup.
This patch adds a simple use case for adding a library to an existing
repository.

Signed-off-by: Dan Sabath <dsabath@whitepages.com>
c6ca48d
kiyose Docs: cleaning up example textual redundancy
Signed-off-by: Dan Sabath <dsabath@whitepages.com>
ae33018
Feb 13, 2010
Added new 'push' command and 2-parameter form of 'add'.
Now you can do:

	git subtree add --prefix=whatever git://wherever branchname

to add a new branch, instead of rather weirdly having to do 'git fetch'
first.  You can also split and push in one step:

	git subtree push --prefix=whatever git://wherever newbranch

(Somewhat cleaned up by apenwarr.)
c00d1d1
May 07, 2010
Pelle Wessman Use 'git merge -Xsubtree' when git version >= 1.7.0.
It's possible to specify the subdir of a subtree since Git 1.7.0 - adding
support for that functionality to make the merge more stable.

Also checking for git version - now only uses the new subtree subdir option
when on at least 1.7.
448e71e
May 20, 2010
Pelle Wessman Fixed regression with splitting out new subtree
A folder in a repository that wasn't initially imported as a  subtree could no longer be splitted into an entirely new subtree with no parent.

A fix and a new test to fix that regression is added here.
39f5fff
Jun 24, 2010
apenwarr (Hopefully) fix PATH setting for msysgit.
Reported by Evan Shaw.  The problem is that $(git --exec-path) includes a
'git' binary which is incompatible with the one in /usr/bin; if you run it,
it gives you an error about libiconv2.dll.

You might think we could just add $(git --exec-path) at the *end* of PATH,
but then if there are multiple versions of git installed, we could end up
with the wrong one; earlier versions used to put git-sh-setup in /usr/bin,
so we'd pick up that one before the new one.

So now we just set PATH back to its original value right after running
git-sh-setup, and we should be okay.
9c632ea
apenwarr Merge remote branch 'origin/master'
* origin/master:
  Fixed regression with splitting out new subtree
  Use 'git merge -Xsubtree' when git version >= 1.7.0.
8e770bd
apenwarr Another fix for PATH and msysgit.
Evan Shaw tells me the previous fix didn't work.  Let's use this one
instead, which he says does work.

This fix is kind of wrong because it will run the "correct" git-sh-setup
*after* the one in /usr/bin, if there is one, which could be weird if you
have multiple versions of git installed.  But it works on my Linux and his
msysgit, so it's obviously better than what we had before.
df2302d
Jul 21, 2010
Bryan Larsen docs: simplify example 1
The documentation was written prior to Wayne Walter's 2-parameter add.
Using 2-parameter add in example 1 makes the example much simpler.
242b20d
Aug 12, 2010
apenwarr Fix typo: an -> a
Thanks to Vanuan on github.
7f74d65
Oct 21, 2010
Cole Stanfield Fixing eval syntax error. 11f1511
John Yani docs: Description, synopsys, options and examples changes.
Description: Made the difference from submodules and the subtree
merge strategy clearer.

Synopsys and options: Synchronize with 'git subtree -h' output.
I hope, properly.

Examples: Added example descriptions in captions. Small fixes.

Signed-off-by: John Yani <vanuan@gmail.com>
7f86ff0
apenwarr Fix a few typos/grammar-o's in the preceding commit. 9a40fcc
Nov 09, 2010
jessegreenwald Split cmd now processes commits in topo order.
Added the "--topo-order" option to git rev-list.  Without this, it seems that
the revision list is coming back in reverse order but it is sorted
chronologically.  This does not gurantee that parent commits are handled
before child commits.
6f4f84f
jessegreenwald Added check to order of processed commits.
With debug messages enabled, "incorrect order" will be output whenever a
commit is processed before its parents have been processed.  This can be
determined by checking to see if a parent isn't mapped to a new commit, but
it has been processed.
915b989
Feb 28, 2011
apenwarr It's also okay if an expected tree object is actually a commit.
...that happens with submodules sometimes, so don't panic.

Reported by Sum-Wai Low.
856bea1
apenwarr Skip commit objects that should be trees, rather than copying them.
An improvement on the previous patch, based on more reports from Sum-Wai
Low.
2793ee6
Jan 03, 2012
perl/Git.pm: "prompt" helper to honor GIT_ASKPASS and SSH_ASKPASS
git-svn reads passwords from an interactive terminal or by using
GIT_ASKPASS helper tool. But if GIT_ASKPASS environment variable is not
set, git-svn does not try to use SSH_ASKPASS as git-core does. This
cause GUIs (w/o STDIN connected) to hang waiting forever for git-svn to
complete (http://code.google.com/p/tortoisegit/issues/detail?id=967).

Earlier, 56a853b (git-svn: Support retrieving passwords with GIT_ASKPASS,
2010-03-02) tried to solve this issue, but was incomplete as described
above.

Instead of using hand-rolled prompt-response code that only works with the
interactive terminal and uses GIT_ASKPASS, introduce prompt() helper
function in Git.pm library that also pays attention to SSH_ASKPASS as a
fallback, and use it in git-svn. The result mimics the behaviour of the
core git better.

Signed-off-by: Sven Strickroth <email@cs-ware.de>
Helped-by: Ævar Arnfjörð Bjarmason
Signed-off-by: Junio C Hamano <gitster@pobox.com>
a4ad8cd
git-svn, perl/Git.pm: extend Git::prompt helper for querying users
git-svn reads usernames and other user queries from an interactive
terminal. This cause GUIs to hang waiting forever for git-svn to complete
(http://code.google.com/p/tortoisegit/issues/detail?id=967) if they are
not connected to the terminal. Give *_ASKPASS helpers preference over
terminal when asking for usernames in git-svn to work around this issue.

This change is technically a small regression for users who have *_ASKPASS
environment defined and expect the username to be read from the terminal;
they now have to type their username to GUI helpers that are likely to be
designed to read passwords without echoing. We may want to swap the
precedence so that we try terminal first when we can to fix this, but that
is outside the scope of this patch.

Signed-off-by: Sven Strickroth <email@cs-ware.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15eaaf4
Jan 04, 2012
Junio C Hamano fixup! 15eaaf4 3f6772a
Feb 11, 2012
greened Move Tests Into Subdirectory
Move the git-subtree tests into a "t" subdir to reflect how
testing works at the top level.

Signed-off-by: David A. Greene <greened@obbligato.org>
9153f19
greened Rename Test
Rename the subtree test file to conform with git project conventions.

Signed-off-by: David A. Greene <greened@obbligato.org>
9e2a55a
greened Use Test Harness
Clean up the git-subtree tests to conform the git project conventions
and use the existing test harness.

Signed-off-by: David A. Greene <greened@obbligato.org>
d3a04e0
Feb 19, 2012
Junio C Hamano xdiff: remove XDL_PATCH_* macros
These are not used anywhere in our codebase, and the bit assignment
definition is merely confusing.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
e5b0662
Junio C Hamano xdiff: PATIENCE/HISTOGRAM are not independent option bits
Because the default Myers, patience and histogram algorithms cannot be in
effect at the same time, XDL_PATIENCE_DIFF and XDL_HISTOGRAM_DIFF are not
independent bits.  Instead of wasting one bit per algorithm, define a few
macros to access the few bits they occupy and update the code that access
them.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
307ab20
Feb 28, 2012
Nguyễn Thái Ngọc Duy index-pack: split second pass obj handling into own function
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
8e8aa58
Mar 06, 2012
unpack-trees: plug minor memory leak
The allocations made by unpack_nondirectories() using create_ce_entry()
are never freed.

In the non-merge case, we duplicate them using add_entry() and later
only look at the first allocated element (src[0]), perhaps even only
by mistake.  Split out the actual addition from add_entry() into the
new helper do_add_entry() and call this non-duplicating function
instead of add_entry() to avoid the leak.

Valgrind reports this for the command "git archive v1.7.9" without
the patch:

  ==13372== LEAK SUMMARY:
  ==13372==    definitely lost: 230,986 bytes in 2,325 blocks
  ==13372==    indirectly lost: 0 bytes in 0 blocks
  ==13372==      possibly lost: 98 bytes in 1 blocks
  ==13372==    still reachable: 2,259,198 bytes in 3,243 blocks
  ==13372==         suppressed: 0 bytes in 0 blocks

And with the patch applied:

  ==13375== LEAK SUMMARY:
  ==13375==    definitely lost: 65 bytes in 1 blocks
  ==13375==    indirectly lost: 0 bytes in 0 blocks
  ==13375==      possibly lost: 0 bytes in 0 blocks
  ==13375==    still reachable: 2,364,417 bytes in 3,245 blocks
  ==13375==         suppressed: 0 bytes in 0 blocks

Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9db8968
Mar 07, 2012
Junio C Hamano streaming: make streaming-write-entry to be more reusable
The static function in entry.c takes a cache entry and streams its blob
contents to a file in the working tree.  Refactor the logic to a new API
function stream_blob_to_fd() that takes an object name and an open file
descriptor, so that it can be reused by other callers.

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
47a02ff
Nguyễn Thái Ngọc Duy Add more large blob test cases
New test cases list commands that should work when memory is
limited. All memory allocation functions (*) learn to reject any
allocation larger than $GIT_ALLOC_LIMIT if set.

(*) Not exactly all. Some places do not use x* functions, but
malloc/calloc directly, notably diff-delta. These code path should
never be run on large blobs.

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
d41489a
Nguyễn Thái Ngọc Duy cat-file: use streaming API to print blobs
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
00c8fd4
Nguyễn Thái Ngọc Duy parse_object: avoid putting whole blob in core
Traditionally, all the callers of check_sha1_signature() first
called read_sha1_file() to prepare the whole object data in core,
and called this function.  The function is used to revalidate what
we read from the object database actually matches the object name we
used to ask for the data from the object database.

Update the API to allow callers to pass NULL as the object data, and
have the function read and hash the object data using streaming API
to recompute the object name, without having to hold everything in
core at the same time.  This is most useful in parse_object() that
parses a blob object, because this caller does not have to keep the
actual blob data around in memory after a "struct blob" is returned.

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
090ea12
Nguyễn Thái Ngọc Duy show: use streaming API for showing blobs
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
74775a0
Nguyễn Thái Ngọc Duy fsck: use streaming API for writing lost-found blobs
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
6f7f3be
Nguyễn Thái Ngọc Duy update-server-info: respect core.bigfilethreshold
This command indirectly calls check_sha1_signature() (add_info_ref ->
deref_tag -> parse_object -> ..) , which may put whole blob in memory
if the blob's size is under core.bigfilethreshold. As config is not
read, the threshold is always 512MB. Respect user settings here.

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
da591a7
Jared Hance apply: do not leak patches and fragments
In the while loop inside apply_patch, patch and fragments are
dynamically allocated with a calloc. However, only unused patches
are actually freed and the rest are left to leak. Since a list is
actively built up consisting of the used patches, they can simply be
iterated and freed at the end of the function.

In addition, the text in fragments were not freed, primarily because
they mostly point into a patch text that is freed as a whole. But
there are some cases where new piece of memory is allocated and
pointed by a fragment (namely, when handling a binary patch).

Introduce a free_patch bitfield to mark each fragment if its text
needs to be freed, and free patches, fragments and fragment text
that need to be freed when we are done with the input.

Signed-off-by: Jared Hance <jaredhance@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
6fe5390
Mar 09, 2012
Matthieu Moy push: start warning upcoming default change for push.default
In preparation for flipping the default to the "upstream" mode from
the "matching" mode that is the historical default, start warning
users when they rely on unconfigured "git push" to default to the
"matching" mode.

Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
5293b54
Mar 11, 2012
Junio C Hamano ident.c: add split_ident_line() to parse formatted ident line
The commit formatting logic format_person_part() in pretty.c
implements the logic to split an author/committer ident line into
its parts, intermixed with logic to compute its output using these
piece it computes.

Separate the former out to a helper function split_ident_line() so
that other codepath can use the same logic, and rewrite the function
using the helper function.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
4b340cf
Junio C Hamano t7503: does pre-commit-hook learn authorship?
When "--author" option is used to lie the authorship to "git commit"
command, hooks should learn the author name and email just like when
GIT_AUTHOR_NAME and GIT_AUTHOR_EMAIL environment variables are used
to lie the authorship.  Test this.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
0486198
Junio C Hamano commit: pass author/committer info to hooks
When lying the author name via GIT_AUTHOR_NAME environment variable
to "git commit", the hooks run by the command saw it and could act
on the name that will be recorded in the final commit. When the user
uses the "--author" option from the command line, the command should
give the same information to the hook, and back when "git command"
was a scripted Porcelain, it did set the environment variable and
hooks can learn the author name from it.

However, when the command was reimplemented in C, the rewritten code
was not very faithful to the original, and hooks stopped getting the
authorship information given with "--author".  Fix this by exporting
the necessary environment variables.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
7dfe8ad
Junio C Hamano run_hook(): enhance the interface to pass arbitrary environment
Originally "run_hook()" that used to live in builtin/commit.c had a
perfectly appropriate API and name for a private function to spawn a
hook from "git commit" command. The only necessary tweak in the
context was to optionally specify which file to use as the index
file.

But then we stupidly moved this private API to run-command.c without
making the interface suitable for general consumption, and there is
no way to tweak environment variables other than GIT_INDEX_FILE when
running a hook.

Correct this mistake by adding run_hook_e() that takes an array of
environment variables.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
dcf082d
Nguyễn Thái Ngọc Duy index-pack: support multithreaded delta resolving
This puts delta resolving on each base on a separate thread, one base
cache per thread. Per-thread data is grouped in struct thread_local.
When running with nr_threads == 1, no pthreads calls are made. The
system essentially runs in non-thread mode.

An experiment on a Xeon 24 core machine with linux-2.6.git shows that
performance does not increase proportional to the number of cores. So
by default, we use maximum 3 cores. Some numbers with --threads from 1
to 16:

1..4
real    1m16.310s  0m48.183s  0m37.866s  0m32.834s
user    1m13.773s  1m15.537s  1m15.781s  1m16.233s
sys     0m2.480s   0m3.936s   0m4.448s   0m4.852s

5..8
real    0m33.170s  0m30.369s  0m28.406s  0m26.968s
user    1m31.474s  1m30.322s  1m29.562s  1m28.694s
sys     0m6.096s   0m6.268s   0m6.684s   0m7.172s

9..12
real    0m26.288s  0m26.207s  0m26.239s  0m24.945s
user    1m29.530s  1m36.146s  1m43.134s  1m34.182s
sys     0m8.129s   0m8.437s   0m9.697s   0m10.201s

13..16
real    0m25.110s  0m25.043s  0m23.955s  0m25.746s
user    1m39.262s  1m43.598s  1m38.350s  1m59.775s
sys     0m10.997s  0m11.553s  0m11.949s  0m13.689s

Thanks to Ramsay Jones for troubleshooting on MinGW platform.

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
c32a1bf
Mar 13, 2012
jrn test: use test_i18ncmp when checking --stat output
Ever since v1.7.9.2~13 (2012-02-01), git's diffstat-style summary line
produced by "git apply --stat", "git diff --stat", and "git commit"
varies by locale, producing test failures when GETTEXT_POISON is set.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
fc5877a
jrn test: use numstat instead of diffstat in funny-names test
This test script checks that git's plumbing commands quote filenames
with special characters like space, tab, and double-quote
appropriately in their input and output.

Since commit v1.7.9.2~13 (Use correct grammar in diffstat summary
line, 2012-02-01), the final "1 file changed, 1 insertion(+)" line
from diffstats is translatable, meaning tests that rely on exact "git
apply --stat" output have to be skipped when git is not configured to
produce output in the C locale (for example, when GETTEXT_POISON is
enabled).  So:

 - Tweak the three "git apply --stat" tests that check "git apply"'s
   input parsing to use --numstat instead.

   --numstat output is more reliable, does not vary with locale, and
   is itself easier to parse.  These tests are mainly about how "git
   apply" parses its input so this should not result in much loss of
   coverage.

 - Add a new "apply --stat" test to check the quoting in --stat output
   format.

This wins back a little of the test coverage lost with the patch
"test: use test_i18ncmp to check --stat output" when GETTEXT_POISON is
enabled.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
e7a8ac3
jrn test: modernize funny-names test style
This is one of the early tests, so it uses a style that by modern
standards can be hard to read.  Tweak it to:

 - clearly declare what assertion each test is designed to check

 - mark tests that create state later tests will depend on with the
   word "setup" so people writing or running tests know the others
   can be skipped or reordered safely

 - put commands that populate a file with expected output inside
   the corresponding test stanza, so it is easier to see by eye
   where each test begins and ends

 - instead of pipelines, use commands that read and write a
   temporary file, so bugs causing commands to segfault or produce
   the wrong exit status can be caught.

More cosmetic changes:

 - put the opening quote starting each test on the same line as the
   test_expect_* invocation, and indent the commands in each test
   with a single tab

 - end the test early if the underlying filesystem cannot
   accomodate the filenames we use, instead of marking all tests
   with the same TABS_IN_FILENAMES prerequisite.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
ef7db19
jrn test: test cherry-pick functionality and output separately
Since v1.7.3-rc0~26^2~9 (revert: report success when using option
--strategy, 2010-07-14), the cherry-pick-many-commits test checks the
format of output written to the terminal during a cherry-pick sequence
in addition to the functionality.  There is no reason those have to
be checked in the same test, though, and it has some downsides:

 - when progress output is broken, the test result does not convey
   whether the functionality was also broken or not

 - it is not immediately obvious when reading that these checks are
   meant to prevent regressions in details of the output format and
   are not just a roundabout way to check functional details like the
   number of commits produced

 - there is a temptation to include the same kind of output checking
   for every new cherry-pick test, which would make future changes
   to the output unnecessarily difficult

Put the tests from v1.7.3-rc0~26^2~9 in separate assertions, following
the principle "test one feature at a time".

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2593633
jrn test: use --numstat instead of --stat in "git stash show" tests
git's diff --stat output is intended for human consumption and
since v1.7.9.2~13 (2012-02-01) varies by locale.  Add a test checking
that git stash show defaults to --stat and tweak the rest of the
"stash show" tests that showed a diffstat to use numstat.

This way, there are fewer tests to tweak if the diffstat format
changes again.  This also improves test coverage when running tests
with git configured not to write its output in the C locale (e.g.,
via GETTEXT_POISON=Yes).

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
1145211
jrn test: use numstat instead of diffstat in binary-diff test
git's --stat output is intended for humans and since v1.7.9.2~13
(2012-02-01) varies by locale.  The tests in this script using "apply
--stat" are meant to check two things:

 - how binary file changes are accounted for and printed in
   git's diffstat format

 - that "git apply" can parse the various forms of binary diff

Split these two kinds of check into separate tests, and use --numstat
instead of --stat in the latter.  This way, we lose less test coverage
when git is being run without writing its output in the C locale (for
example because GETTEXT_POISON is enabled) and there are fewer tests
to change if the --stat output needs to be tweaked again.

While at it, use commands separated by && that read and write to
temporary files in place of pipelines so segfaults and other failures
in the upstream of the processing pipeline don't get hidden.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2983c0e
jrn diffstat summary line varies by locale: miscellany
These changes are in the same spirit as the six patches that
precede them, but they haven't been split into individually
justifiable patches yet.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
6dd8883
Nguyễn Thái Ngọc Duy Add column layout skeleton and git-column
A column option string consists of many token separated by either
a space or a  comma. A token belongs to one of three groups:

 - enabling: always, never and auto
 - layout mode: currently plain (which does not layout at all)
 - other future tuning flags

git-column can be used to pipe output to from a command that wants
column layout, but not to mess with its own output code. Simpler output
code can be changed to use column layout code directly.

Thanks-to: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
301cb19
Nguyễn Thái Ngọc Duy Stop starting pager recursively
git-column can be used as a pager for other git commands, something
like this:

    GIT_PAGER="git -p column --mode='dense color'" git -p branch

The problem with this is that "git -p column" also has $GIT_PAGER set so
the pager runs itself again as another pager. The end result is an
infinite loop of forking. Other git commands have the same problem if
being abused this way.

Check if $GIT_PAGER is already set and stop launching another pager.

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
a464759
Nguyễn Thái Ngọc Duy column: add columnar layout
COL_COLUMN and COL_ROW fill column by column (or row by row
respectively), given the terminal width and how many space between
columns. All cells have equal width.

Strings are supposed to be in UTF-8. Valid ANSI escape strings are OK.

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
8ab2a3f
Nguyễn Thái Ngọc Duy column: add dense layout support
Normally all cells (and in turn columns) share the same width. This
layout mode can waste space because one long item can stretch our all
columns.

With COL_DENSE enabled, column width is calculated indepdendently. All
columns are shrunk to minimum, then it attempts to push cells of the
last row over to the next column with hope that everything still fits
even there's one row less. The process is repeated until the new layout
cannot fit in given width any more, or there's only one row left
(perfect!).

Apparently, this mode consumes more cpu than the old one, but it makes
better use of terminal space. For layouting one or two screens, cpu
usage should not be detectable.

This patch introduces option handling code besides layout modes and
enable/disable to expose this feature as "dense". The feature can be
turned off by specifying "nodense".

Thanks-to: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
43ac0e7
Nguyễn Thái Ngọc Duy help: reuse print_columns() for help -a
"help -a" also respects column.ui (and column.help if presents)

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
d69da30
Nguyễn Thái Ngọc Duy branch: add --column
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
0fc923f
Nguyễn Thái Ngọc Duy status: add --column
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
51de6b9
Nguyễn Thái Ngọc Duy column: support piping stdout to external git-column process
For too complicated output handling, it'd be easier to just spawn
git-column and redirect stdout to it. This patch provides helpers
to do that.

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
705d4e8
Nguyễn Thái Ngọc Duy tag: add --column
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
417ef1f
Nguyễn Thái Ngọc Duy ls-files: support --column
.. because ls-files is a good show case to the next patches..

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4169af6
Nguyễn Thái Ngọc Duy column: support "denser" mode
Sometimes a few long entries in the listing would stretch out columns,
wasting space. If these entries are cut out, the columns could become
smaller, hence more columns.

This new mode does that by looking for the longest entry, if cutting the
list before that entry results in much denser layout, then the entry
will be cut out and printed in a separate line. The remaining will put
in a new layout.

Multiple tables with different column width might be unpleasant to
look at, especially if the tables are really short. But on the other
hand it could be quite handy. For example,
"COLUMNS=80 ./git ls-files --column=dense -- '*.[ch]'" takes 415
lines, while "denser" only takes 223 because it break the layout at
contrib/credential/osxkeychain/git-credential-osxkeychain.c
and relayout again:

abspath.c                  builtin/rm.c
advice.c                   builtin/send-pack.c
<snip>
builtin/rev-parse.c        connected.h
builtin/revert.c           contrib/convert-objects/convert-objects.c

contrib/credential/osxkeychain/git-credential-osxkeychain.c

contrib/examples/builtin-fetch--tool.c refs.c                   xdiff/xutils.c
contrib/svn-fe/svn-fe.c                refs.h                   xdiff/xutils.h
convert.c                              remote-curl.c            zlib.c
convert.h                              remote.c
<snip>
reflog-walk.c                          xdiff/xprepare.h
reflog-walk.h                          xdiff/xtypes.h

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
ee8a84f
Nguyễn Thái Ngọc Duy column: support grouping entries
If many entries share the same prefix (e.g. "git ls-files Documentation/"),
cutting out the prefix helps put more information on the same space.

If "group" is specified, the list of entries will be searched for
largest non-overlapping rectangles of text. Estimation is done on each
rectangle to see if there are any savings in rows if we group them.
Groups are printed first, then the remaining as the last group.

Handling the remaining part this way may not be ideal but I don't want
to split all directories like "ls -R". That takes too many lines.
Maybe I should prepend ".../" to all grouped items to make it clear
they are grouped.  There's also problem with ansi escape codes that
I'll need to handle if this sounds like a good way to go.

This code may be used for diffstat too (e.g. when most of the diff is
in Documentation/).

For demonstration, this is what
"COLUMNS=80 git ls-files --column=group -- '*.[ch]'" looks like

builtin/:
add.c                gc.c                 read-tree.c
annotate.c           grep.c               receive-pack.c
<snip>
for-each-ref.c       prune.c              verify-tag.c
fsck.c               push.c               write-tree.c

compat/:
basename.c                  regex/regexec.c
bswap.h                     setenv.c
<snip>
regex/regex_internal.c      win32mmap.c
regex/regex_internal.h      winansi.c

contrib/:
convert-objects/convert-objects.c
credential/osxkeychain/git-credential-osxkeychain.c
examples/builtin-fetch--tool.c
svn-fe/svn-fe.c

vcs-svn/:
fast_export.c    line_buffer.h    sliding_window.c svndiff.h
fast_export.h    repo_tree.c      sliding_window.h svndump.c
line_buffer.c    repo_tree.h      svndiff.c        svndump.h

xdiff/:
xdiff.h      xemit.c      xinclude.h   xpatience.c  xtypes.h
xdiffi.c     xemit.h      xmacros.h    xprepare.c   xutils.c
xdiffi.h     xhistogram.c xmerge.c     xprepare.h   xutils.h

...:
abspath.c                  pack-check.c
advice.c                   pack-refs.c
<snip>
object.c                   xdiff-interface.h
object.h                   zlib.c

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
a464ab9
Junio C Hamano fmt-merge-msg: show those involved in a merged series
As we already walk the history of the branch that gets merged to
come up with a short log, let's label it with names of the primary
authors, so that the user who summarizes the merge can easily give
credit to them in the log message.

Also infer the names of "lieutents" to help integrators at higher
level of the food-chain to give credit to them, by counting:

 * The committer of the 'tip' commit that is merged
 * The committer of merge commits that are merged

Often the first one gives the owner of the history being pulled, but
his last pull from his sublieutenants may have been a fast-forward,
in which case the first one would not be.  The latter rule will
count the integrator of the history, so together it might be a
reasonable heuristics.

There are two special cases:

 - The "author" credit is omitted when the series is written solely
   by the same author who is making the merge. The name can be seen
   on the "Author" line of the "git log" output to view the log
   message anyway.

 - The "lieutenant" credit is omitted when there is only one key
   committer in the merged branch and it is the committer who is
   making the merge. Typically this applies to the case where the
   developer merges his own branch.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
418a143
Mar 14, 2012
t4034: diff.*.wordregex should not be "sticky" in --word-diff
The test case applies a custom wordRegex to one file in a diff, and expects
that the default word splitting applies to the second file in the diff.
But the custom wordRegex is also incorrectly used for the second file.

Helped-by: Thomas Rast <trast@student.ethz.ch>
Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
62d3935
trast diff: refactor the word-diff setup from builtin_diff_cmd
Quite a chunk of builtin_diff_cmd deals with word-diff setup, defaults
and such.  This makes the function a bit hard to read, but is also
asymmetric because the corresponding teardown lives in free_diff_words_data
already.

Refactor into a new function init_diff_words_data.  For simplicity,
also shuffle around some functions it depends on.

Signed-off-by: Thomas Rast <trast@student.ethz.ch>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
77d1a52
trast diff: tweak a _copy_ of diff_options with word-diff
When using word diff, the code sets the word_regex from various
defaults if it was not set already.  The problem is that it does this
on the original diff_options, which will also be used in subsequent
diffs.

This means that when the word_regex is not given on the command line,
only the first diff for which a setting for word_regex (either from
attributes or diff.wordRegex) ever takes effect.  This value then
propagates to the rest of the diff runs and in particular prevents
further attribute lookups.

Fix the problem of changing diff state once and for all, by working
with a _copy_ of the diff_options.

Noticed-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Thomas Rast <trast@student.ethz.ch>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
6440d34
Mar 15, 2012
keszybz t0303: immediately bail out w/o GIT_TEST_CREDENTIAL_HELPER
t0300-credential-helpers.sh requires GIT_TEST_CREDENTIAL_HELPER to be
configured to do something sensible. If it is not set, prove will say:
  ./t0303-credential-external.sh .. skipped: (no reason given)
which isn't very nice.

Use skip_all="..." && test_done to bail out immediately and provide a
nicer message. In case GIT_TEST_CREDENTIAL_HELPER is set, but the
timeout tests are skipped, mention GIT_TEST_CREDENTIAL_HELPER_TIMEOUT.

Signed-off-by: Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Acked-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16e4481
keszybz t0303: resurrect commit message as test documentation
The commit message which added those tests (861444f 't: add test
harness for external credential helpers' 2011-12-10) provided nice
documentation in the commit message. Let's make it more visible
by putting it in the test description.

The documentation is updated to reflect the fact that
GIT_TEST_CREDENTIAL_HELPER must be set for
GIT_TEST_CREDENTIAL_HELPER_TIMEOUT to be used
and GIT_TEST_CREDENTIAL_HELPER_SETUP can be used.

Based-on-commit-message-by: Jeff King <peff@peff.net>
Signed-off-by: Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Acked-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
6c556cb
Junio C Hamano remove_dir_recursively(): Add flag for skipping removal of toplevel dir
Add the REMOVE_DIR_KEEP_TOPLEVEL flag to remove_dir_recursively() for
deleting everything inside the given directory, but _not_ the given
directory itself.

Note that this does not pass the REMOVE_DIR_KEEP_NESTED_GIT flag, if set,
to the recursive invocations of remove_dir_recursively().  It is likely to
be a a bug that has been present since REMOVE_DIR_KEEP_NESTED_GIT was
introduced (a0f4afb), but this commit keeps the same behaviour for now.

Signed-off-by: Johan Herland <johan@herland.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
c844a80
Johan Herland t3310: illustrate failure to "notes merge --commit" inside $GIT_DIR/
The 'git notes merge' command expected to be run from the working
tree of the project being annotated, and did not anticipate getting
run inside $GIT_DIR/.

However, because we use $GIT_DIR/NOTES_MERGE_WORKTREE as a temporary
working space for the user to work on resolving conflicts, it is not
unreasonable for a user to run "git notes merge --commit" there. But
the command fails to do so.

Found-by: David Bremner <david@tethera.net>
Signed-off-by: Johan Herland <johan@herland.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
01bfec8
Johan Herland notes-merge: use opendir/readdir instead of using read_directory()
notes_merge_commit() only needs to list all entries (non-recursively)
under a directory, which can be easily accomplished with
opendir/readdir and would be more lightweight than read_directory().

read_directory() is designed to list paths inside a working
directory. Using it outside of its scope may lead to undesired effects.

Apparently, one of the undesired effects of read_directory() is that it
doesn't deal with being given absolute paths. This creates problems for
notes_merge_commit() when git_path() returns an absolute path, which
happens when the current working directory is in a subdirectory of the
.git directory.

Originally-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Updated-by:  Johan Herland <johan@herland.net>
Signed-off-by: Johan Herland <johan@herland.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
a0be62c
Johan Herland notes-merge: Don't remove .git/NOTES_MERGE_WORKTREE; it may be the us…
…er's cwd

When a manual notes merge is committed or aborted, we need to remove the
temporary worktree at .git/NOTES_MERGE_WORKTREE. However, removing the
entire directory is not good if the user ran the 'git notes merge
--commit/--abort' from within that directory. On Windows, the directory
removal would simply fail, while on POSIX systems, users would suddenly
find themselves in an invalid current directory.

Therefore, instead of deleting the entire directory, we delete everything
_within_ the directory, and leave the (empty) directory in place.

This would cause a subsequent notes merge to abort, complaining about a
previous - unfinished - notes merge (due to the presence of
.git/NOTES_MERGE_WORKTREE), so we also need to adjust this check to only
trigger when .git/NOTES_MERGE_WORKTREE is non-empty.

Finally, adjust the t3310 manual notes merge testcases to correctly handle
the existence of an empty .git/NOTES_MERGE_WORKTREE directory.

Inspired-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Johan Herland <johan@herland.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
dabba59
Junio C Hamano clean: preserve nested git worktree in subdirectories
remove_dir_recursively() has a check to avoid removing the directory it
was asked to remove without recursing into it and report success when the
directory is the top level of a working tree of a nested git repository,
to protect such a repository from "clean -f" (without double -f). If a
working tree of a nested git repository is in a subdirectory of a toplevel
project, however, this protection did not apply by mistake; we forgot to
pass the REMOVE_DIR_KEEP_NESTED_GIT down to the recursive removal
codepath.

This requires us to also teach the higher level not to remove the
directory it is asked to remove, when the recursed invocation did not
remove the directory it was asked to remove due to a nested git
repository, as it is not an error to leave the parent directories of such
a nested repository.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
ae2f203
http: try http_proxy env var when http.proxy config option is not set
cURL already reads it, but if $http_proxy has username but no password
cURL will not ask you for the password and so failed to authenticate
returning a 407 error code. So we read it ourselves to detect that and
ask for the password. Also we read it prior to connection to be able to
make a proactive authentication in case the flag http_proactive_auth is
set.

We also take care to read env proxy var according to protocol being
used in the destination url, e.g.  when the url to retrieve is a https
one, then the proxy env var we look at is https_proxy. To make this
possible we now passed destination url parameter to get_active_slot()
and get_curl_handle() functions.

We also read no_proxy env var so to ignore aforementioned proxy env var
if no_proxy contains an asterisk ('*') or contains the host used in url
destination.

Signed-off-by: Nelson Benitez Leon <nbenitezl@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4e241d8
http: handle proxy proactive authentication
If http_proactive_auth flag is set and there is a username
but no password in the proxy url, then interactively ask for
the password.

This makes possible to not have the password written down in
http_proxy env var or in http.proxy config option.

Also take care that CURLOPT_PROXY don't include username or
password, as we now set them in the new set_proxy_auth() function
where we use their specific cURL options.

Signed-off-by: Nelson Benitez Leon <nbenitezl@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
6e17b8c
http: handle proxy authentication failure (error 407)
Handle http 407 error code by asking for credentials and
retrying request in case credentials were not present, or
marking credentials as rejected if they were already provided.

Signed-off-by: Nelson Benitez Leon <nbenitezl@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4896c48
http: Avoid limit of retrying request only twice
Current code, after receiving HTTP_REAUTH, only retried
once, so couldn't do step 3 of the following sequence:

  1. We make a request; proxy returns 407, because we didn't give it a
     password. We ask for the password and return HTTP_REAUTH.

  2. We make another request; the proxy passes it to the actual server,
     who returns 401, because we didn't give an http password. We ask
     for the password and return HTTP_REAUTH.

  3. We make a third request, but this time everybody is happy.

Now we retry as long as we keep receiving HTTP_REAUTH, so the previous
sequence correctly completes.

Patch by Jeff King <peff@peff.net>

Signed-off-by: Nelson Benitez Leon <nbenitezl@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2217c38
http: rename HTTP_REAUTH to HTTP_AUTH_RETRY
After adding the proxy authentication support in http, the semantics
of HTTP_REAUTH changed more to a retry rather than a re-authentication,
so we rename it to HTTP_AUTH_RETRY.

Signed-off-by: Nelson Benitez Leon <nbenitezl@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
72d62ef
Mar 16, 2012
Junio C Hamano bulk-checkin: allow the same data to be multiply hashed
This updates stream_to_pack() machinery to feed the data it is writing out
to multiple hash contexts at the same time. Right now we only use a single
git_SHA_CTX, so there is no change in functionality.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
1c708fe
Junio C Hamano new representation types in the packstream
In addition to the four basic types (commit, tree, blob and tag), the pack
stream can encode a few other "representation" types, such as REF_DELTA
and OFS_DELTA.  As we allocate 3 bits in the first byte for this purpose,
we do not have much room to add new representation types in place, but we
do have one value reserved for future expansion.

When encoding a new representation type, the early part of the in-pack
object header is encoded as if its type is OBJ_EXT (= 5).  The lower 4-bit
of the first byte is used for the lowest 4-bit of the size information,
the next 3-bit has the type information, and the MSB says if the
subsequent bytes need to be read to decode higher bits for the size
information.

An in-pack object header that records OBJ_EXT as its type is followed by
an integer in the same variable-length encoding as OFS_DELTA offset is
encoded in.  This value is the real type of the representation minus 8 (as
we do not need to use OBJ_EXT to encode types smaller than 8).  Because we
do not foresee very many representation types, in practice we would have a
single byte with its MSB clear, to represent types 8-135.

The code does not add nor use type=8 and upwards for anything yet.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
b92e1f9
Junio C Hamano varint-in-pack: refactor varint encoding/decoding
Refactor encode/decode_in_pack_varint() functions from OFS_DELTA codepaths
to read and write variable-length integers in the pack stream.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
0872b68
Junio C Hamano bulk-checkin: support chunked-object encoding
Instead of recording a huge object as a single entry in the packfile,
record it as a concatenation of smaller blob objects. This is primarily to
make it possible to repack repositories with huge objects and transfer
them out of such repositories.

This is the first step of a long and painful journey. We would still need
to teach many codepaths about the new encoding:

 * The streaming checkout codepath must learn how to read these from the
   object store and write a concatenation of component blob contents to
   the working tree. Note that after a repack, a component blob object
   could be represented as a delta to another blob object.

 * The in-core object reading codepath must learn to notice and at least
   reject reading such objects entirely in-core. It is expected that
   nobody is interested in producing a patch out of these huge objects, at
   least initially.

 * The object connectivity machinery must learn that component blob
   objects are reachable from an object that uses them, so that "gc"
   will not lose them, and "fsck" will not complain about them.

 * The pack-object machinery must learn to copy an object that is encoded
   in chunked-object encoding as-is to the destination, while perhaps
   validating the object name, without having to first come up with a huge
   concatenated blob and then split it again into smaller pieces. It also
   must learn that the component blobs need to be packed when it does so.

 * The index-pack and verify-pack machineries need to be told about the
   objects in the chunked encoding.

The split-chunk logic used here is kept deliberately useless in order to
avoid distracting the reviewers.  We will want to replace it with a better
heuristics---the rest of the system is designed not to care, so that the
heuristics can be improved without any compatibility issues.

One possibility is to use the heuristics "bup" uses, which is based on a
self-synchronizing rolling checksum logic; if it works as advertised, we
should be able to obtain a good reuse of component blobs when only small
parts of a large blob in chunked encoding are updated.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
21aa04b
Junio C Hamano chunked-object: fallback checkout codepaths
This prepares the default codepaths based on the traditional "slurping
everything in-core" model around read_sha1_file() API for objects that use
chunked encoding. Needless to say, these codepaths are unsuitable for the
kind of objects that use chunked encoding and are intended to only serve
as the fallback where specialized "large object API" support is still
lacking.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
01f654e
Junio C Hamano chunked-object: streaming checkout
Define a new streaming decoder to handle blobs stored in chunked encoding,
so that we do not have to slurp the data for the whole object to check it
out to the working tree.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
4a1242d
Mar 19, 2012
David Aguilar t7800: Test difftool passing arguments to diff
git-difftool relies on the ability to forward unknown arguments
to the git-diff command.  Add a test to ensure that this works
as advertised.

Signed-off-by: David Aguilar <davvid@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
d50b2c7
Christopher Tiwald push: Provide situational hints for non-fast-forward errors
Pushing a non-fast-forward update to a remote repository will result in
an error, but the hint text doesn't provide the correct resolution in
every case. Give better resolution advice in three push scenarios:

1) If you push your current branch and it triggers a non-fast-forward
error, you should merge remote changes with 'git pull' before pushing
again.

2) If you push to a shared repository others push to, and your local
tracking branches are not kept up to date, the 'matching refs' default
will generate non-fast-forward errors on outdated branches. If this is
your workflow, the 'matching refs' default is not for you. Consider
setting the 'push.default' configuration variable to 'current' or
'upstream' to ensure only your current branch is pushed.

3) If you explicitly specify a ref that is not your current branch or
push matching branches with ':', you will generate a non-fast-forward
error if any pushed branch tip is out of date. You should checkout the
offending branch and merge remote changes before pushing again.

Teach transport.c to recognize these scenarios and configure push.c
to hint for them. If 'git push's default behavior changes or we
discover more scenarios, extension is easy. Standardize on the
advice API and add three new advice variables, 'pushNonFFCurrent',
'pushNonFFDefault', and 'pushNonFFMatching'. Setting any of these
to 'false' will disable their affiliated advice. Setting
'pushNonFastForward' to false will disable all three, thus preserving the
config option for users who already set it, but guaranteeing new
users won't disable push advice accidentally.

Based-on-patch-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Christopher Tiwald <christiwald@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
f25950f
Mar 20, 2012
lucianposton log --graph --stat: three-dash separator should come after graph lines
Output from "git log --graph --stat -p" emits the three-dash separator
line before the graph that shows ancestry lines.  The separator should
come after the ancestry lines just like all the other output.

Signed-off-by: Lucian Poston <lucian.poston@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
aea69a0
lucianposton log --graph: fix break in graph lines
Output from "git log --graph --stat -p" broke the ancestry graph lines
with a single empty line between the diffstat and the patch.

Signed-off-by: Lucian Poston <lucian.poston@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
b18e97c
lucianposton t4202: add test for "log --graph --stat -p" separator lines
Add tests to make sure that the three-dash separator lines appear
after the graph ancestry lines, and also the graph ancestry lines
are not broken between the diffstat and the patch.

Signed-off-by: Lucian Poston <lucian.poston@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
e2c5966
Junio C Hamano rebase -i: remind that the lines are top-to-bottom
Nelson Benitez Leon opened a discussion with a patch with this in the
note:

    Hi, I was using git rebase -i for some time now and never occured to
    me I could reorder the commit lines to affect the order the commits
    are applied, learnt that recently from a git tutorial.

Nelson's patch was to stress the fact that the lines in the insn sheet can
be re-ordered in a much more verbose way.  Let's add a one-liner reminder
and also remind that the lines in the insn sheet is read from top to
bottom, unlike the "git log" output.

Discussion-triggered-by: Nelson Benitez Leon
Signed-off-by: Junio C Hamano <gitster@pobox.com>
8a93f95
Junio C Hamano merge: backport GIT_MERGE_AUTOEDIT support
Even though 1.7.9.x series does not open the editor by default
when merging in general, it does do so in one occassion: when
merging an annotated tag. And worse yet, there is no good way
for older scripts to decline this.

Backport the support for GIT_MERGE_AUTOEDIT environment variable
from 1.7.10 track to help those stuck on 1.7.9.x maintenance
track.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
d387868
greened Set TEST_DIRECTORY
Set TEST_DIRECTORY to the main git test area.  This allows the
git-subtree out-of-tree tests to run correctly.

Signed-off-by: David A. Greene <greened@obbligato.org>
1f30551
greened Remove Unneeded Files
Remove redundant or otherwise unnecessary files.  Most of these
exist in the git project repository.

Signed-off-by: David A. Greene <greened@obbligato.org>
c240828
greened Use Project Config Files
Use project-wide files to process documentation for git-subtree.

Signed-off-by: David A. Greene <greened@obbligato.org>
37ccc9d
greened Build Subtree
Put subtree in the main git command area so it will be installed
along with everything else.  This only happens if the user explicitly
builds in contrib/subtree.

Signed-off-by: David A. Greene <greened@obbligato.org>
4822450
greened Add Subtree Test Makefile
Add a Makefile to run subtree tests.  This is largely copied
from the standard test suite with irrelevant targets removed
and some paths altered to account for where subtree tests live.

Signed-off-by: David A. Greene <greened@obbligato.org>
2e63f75
Mar 23, 2012
Tim Henigan difftool: parse options using Getopt::Long
Replace custom option/argument parser with standard Getopt::Long
module.  This shortens the code and makes it easier to understand.

Signed-off-by: Tim Henigan <tim.henigan@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
3f94ff7
Tim Henigan difftool: add '--no-gui' option
This commit teaches difftool to handle the '--no-gui' option. This option
negates the existing '--gui' option. The last setting given on the command
line wins.

This allows a user to configure "[alias] mdt = difftool --gui", but still
have the ability to override the setting without error:

$ git mdt --no-gui

Signed-off-by: Tim Henigan <tim.henigan@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
8508960
Tim Henigan difftool: exit(0) when usage is printed
Prior to this commit, the script exited with an error whenever the
usage string was printed, regardless of the reason it was done. In
cases where usage was printed due to a user request (e.g. '-h'
option), the script should exit without error (exit 0).

This commit adds an argument to the usage function that allows the
exit code to be specified when the function is called.

Signed-off-by: Tim Henigan <tim.henigan@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2836076
Tim Henigan difftool: remove explicit change of PATH
Adding the script directory to PATH is not needed. The script is
located at '$(git --exec-path)', which is already on the PATH.

Signed-off-by: Tim Henigan <tim.henigan@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
db60708
Tim Henigan difftool: stop appending '.exe' to git
The system call to Git works the same whether or not ".exe" is
appended to "git". The extra code is not necessary.

Signed-off-by: Tim Henigan <tim.henigan@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11bf870
Tim Henigan difftool: eliminate setup_environment function
Removing this function shortens the code and makes it easier to read.
Now all environment variables are set as part of procedural operation.

Signed-off-by: Tim Henigan <tim.henigan@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
e965361
Tim Henigan difftool: replace system call with Git::command_noisy
The Git.pm module includes functions intended to standardize working
with Git repositories in Perl scripts. This commit teaches difftool
to use Git::command_noisy rather than a system call to run the diff
command.

Signed-off-by: Tim Henigan <tim.henigan@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
0440ed7
Tim Henigan difftool: teach difftool to handle directory diffs
Prior to this commit, the difftool utility could only open files one
at a time.  The new '--dir-diff' option copies all the modified files
to a temporary location and runs a directory diff on them.

Signed-off-by: Tim Henigan <tim.henigan@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
6fbdb7b
Jeff King drop casts from users EMPTY_TREE_SHA1_BIN
This macro already evaluates to the correct type, as it
casts the string literal to "unsigned char *" itself
(and callers who want the literal can use the _LITERAL
form).

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
cba595b
Jeff King make is_empty_blob_sha1 available everywhere
The read-cache implementation defines this static function,
but it is a generally useful concept in git. Let's give
the empty blob the same treatment as the empty tree,
providing both hex and binary forms of the sha1.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
f8582ca
Jeff King teach diffcore-rename to optionally ignore empty content
Our rename detection is a heuristic, matching pairs of
removed and added files with similar or identical content.
It's unlikely to be wrong when there is actual content to
compare, and we already take care not to do inexact rename
detection when there is not enough content to produce good
results.

However, we always do exact rename detection, even when the
blob is tiny or empty. It's easy to get false positives with
an empty blob, simply because it is an obvious content to
use as a boilerplate (e.g., when telling git that an empty
directory is worth tracking via an empty .gitignore).

This patch lets callers specify whether or not they are
interested in using empty files as rename sources and
destinations. The default is "yes", keeping the original
behavior. It works by detecting the empty-blob sha1 for
rename sources and destinations.

One more flexible alternative would be to allow the caller
to specify a minimum size for a blob to be "interesting" for
rename detection. But that would catch small boilerplate
files, not large ones (e.g., if you had the GPL COPYING file
in many directories).

A better alternative would be to allow a "-rename"
gitattribute to allow boilerplate files to be marked as
such. I'll leave the complexity of that solution until such
time as somebody actually wants it. The complaints we've
seen so far revolve around empty files, so let's start with
the simple thing.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
90d43b0
Jeff King merge-recursive: don't detect renames of empty files
Merge-recursive detects renames so that if one side modifies
"foo" and the other side moves it to "bar", the modification
is applied to "bar". However, our rename detection is based
on content analysis, it can be wrong (i.e., two files were
not intended as a rename, but just happen to have the same
or similar content).

This is quite rare if the files actually contain content,
since two unrelated files are unlikely to have exactly the
same content.  However, empty files present a problem, in
that there is nothing to analyze. An uninteresting
placeholder file with zero bytes may or may not be related
to a placeholder file with another name.

The result is that adding content to an empty file may cause
confusion if the other side of a merge removed it; your
content may end up in another random placeholder file that
was added.

Let's err on the side of caution and not consider empty
files as renames. This will cause a modify/delete conflict
on the merge, which will let the user sort it out
themselves.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4f7cb99
Mar 25, 2012
greened Add 'contrib/subtree/' from commit '2e63f75b8f49abe220ef55ec4e978e7a3…
…b8dc351'

git-subtree-dir: contrib/subtree
git-subtree-mainline: c16df57
git-subtree-split: 2e63f75
a82bb3e
combine-diff: fix loop index underflow
If both la and context are zero at the start of the loop, la wraps around
and we end up reading from memory far away.  Skip the loop in that case
instead.

Reported-by: Julia Lawall <julia.lawall@lip6.fr>
Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
e5e9b56
Mar 26, 2012
Stefano Lattarini configure: move definitions of private m4 macros before AC_INIT invoc…
…ation

This way, no spurious comments nor whitespace will be propagated in the
generated configure script.

This change is a pure code movement (plus addition of a comment line).

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
e9e8c80
Stefano Lattarini configure: avoid some code repetitions thanks to m4_{push,pop}def
This change is just cosmetic, and should cause no semantic change, nor
any change in the generated configure script.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
99cccef
Stefano Lattarini configure: be more idiomatic
Lots of code in Git's configure.ac doesn't follow the typical formatting,
idioms and best practices for Autoconf input files.  Improve the situation.

There are probably many more similar improvements to be done, but trying
to clump all of them in a single change would make it unreviewable, so we
content ourselves with a partial improvement.

This change is just cosmetic, and should cause no semantic change.

The most relevant of the changes introduced by this patch are:

 - Do not add trailing '\' characters for line continuation where they
   are not truly needed.

 - In several (but not all) macro calls, properly quote the arguments.

 - Few cosmetic changes in spacing and comments.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
5b2d131
Jeff King clean up struct ref's nonfastforward field
Each ref structure contains a "nonfastforward" field which
is set during push to show whether the ref rewound history.
Originally this was a single bit, but it was changed in
f25950f (push: Provide situational hints for non-fast-forward
errors) to an enum differentiating a non-ff of the current
branch versus another branch.

However, we never actually set the member according to the
enum values, nor did we ever read it expecting anything but
a boolean value. But we did use the side effect of declaring
the enum constants to store those values in a totally
different integer variable. The code as-is isn't buggy, but
the enum declaration inside "struct ref" is somewhat
misleading.

Let's convert nonfastforward back into a single bit, and
then define the NON_FF_* constants closer to where they
would be used (they are returned via the "int *nonfastforward"
parameter to transport_push, so we can define them there).

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
e339aa9
Jeff King checkout: suppress tracking message with "-q"
Like the "switched to..." message (which is already
suppressed by "-q"), this message is purely informational.
Let's silence it if the user asked us to be quiet.

This patch is slightly more than a one-liner, because we
have to teach create_branch to propagate the flag all the
way down to install_branch_config.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
f9a482e
Jeff King teach "git branch" a --quiet option
There's currently no way to suppress the informational
"deleted branch..." or "set up tracking..." messages.  This
patch provides a "-q" option to do so.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
d65ddf1
Mar 27, 2012
Junio C Hamano apply: rename free_patch() to free_patch_list()
As that is the only logical name for a function that walks a list
and frees each element on it.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
a604dde
Junio C Hamano apply: free patch->{def,old,new}_name fields
These were all allocated in the heap by parsing the header parts of the
patch, but we did not bother to free them.  Some used to share the memory
(e.g. copying def_name to old_name) so this is not just the matter of
adding three calls to free().

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2901bbe
Junio C Hamano apply: release memory for fn_table
The fn_table is used to record the result of earlier patch application in
case a hand-crafted input file contains multiple patches to the same file.
Both its string key (filename) and the contents are borrowed from "struct
patch" that represents the previous application in the same apply_patch()
call, and they do not leak, but the table itself was not freed properly.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
5c87743
Junio C Hamano apply: free patch->result
This is by far the largest piece of data, much larger than the patch and
fragment structures or the three name fields in the patch structure.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
8192a2f
Mar 28, 2012
Junio C Hamano am -3: list the paths that needed 3-way fallback
When applying a patch that was based on an older release with "am -3", I
often wonder changes to which files need to be reviewed with extra care to
spot mismerges, but there is no good indication.

The paths that needed 3-way fallback can easily be obtained by comparing
the synthesized (partial) base tree and the current HEAD and noticing only
additions and modifications (removals only show the sparseness of the fake
ancestor tree, which is not useful information at all).  List them in the
usual --name-status format.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
5d86861
jmberg am: support --include option
am supports a number of pass-through options
to apply, like --exclude and --directory. Add
--include to this list.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
58725ef
config: remove useless assignment
v1.7.9-8-g270a344 (config: stop using config_exclusive_filename) replaced
config_exclusive_filename with given_config_file.  In one case this
resulted in a self-assignment, which is reported by clang as a warning.
Remove the useless code.

Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Acked-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
b3065bd
Junio C Hamano apply: free unused fragments for submodule patch
We simply discarded the fragments that we are not going to use upon seeing
a patch to update the submodule commit bound at path that we have not
checked out.

Free these fragments, not to leak them.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
9d16c2d
Junio C Hamano apply.c: WIP ownership audit
Add a few comments on ownership, and tighten constness of a few line
buffer variables.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
c713ff5
Mar 29, 2012
gitweb: esc_html_hl_regions(): Don't create empty <span> elements
if $s->[1] is equal to or less than $s->[0], esc_html_hl_regions()
generates an empty <span> element.  It normally shouldn't be visible in
the web broweser, but it doesn't look good when looking at page source.
It also minimally increases generated page size for no special reason.

Signed-off-by: Michał Kiedrowicz <michal.kiedrowicz@gmail.com>
57ab319
gitweb: Pass esc_html_hl_regions() options to esc_html()
With this change, esc_html_hl_regions() accepts options and passes them
down to esc_html().  This may be needed if a caller wants to pass
-nbsp=>1 to esc_html().

The idea and implementation example of this change was described in
337da8d (gitweb: Introduce esc_html_match_hl and esc_html_hl_regions,
2012-02-27).  While other suggestions may be more useful in some cases,
there is no need to implement them at the moment.  The
esc_html_hl_regions() interface may be changed later if it's needed.

Signed-off-by: Michał Kiedrowicz <michal.kiedrowicz@gmail.com>
1a60532
gitweb: Extract print_sidebyside_diff_lines()
Currently, print_sidebyside_diff_chunk() does two things: it
accumulates diff lines and prints them.  Accumulation may be used to
perform additional operations on diff lines,  so it makes sense to split
these two things.  Thus, the code that prints diff lines in a side-by-side
manner is moved out of print_sidebyside_diff_chunk() to a separate
subroutine.

The outcome of this patch is that print_sidebyside_diff_chunk() is now
much shorter and easier to read.

This is a preparation patch for diff refinement highlightning.  It should
not change the gitweb output, but it slightly changes its behavior.
Before this commit, context is printed on the class change. Now, it'it
printed just before printing added and removed lines.

Signed-off-by: Michał Kiedrowicz <michal.kiedrowicz@gmail.com>
eb51d07
gitweb: Use print_diff_chunk() for both side-by-side and inline diffs
This renames print_sidebyside_diff_chunk() to print_diff_chunk() and
makes use of it for both side-by-side and inline diffs.  Now diff lines
are always accumulated before they are printed.  This opens the
possibility to preprocess diff output before it's printed, which is
needed for diff refinement highlightning (implemented in incoming
patches).

If left as is, the new function print_inline_diff_lines() could reorder
diff lines.  It first prints all context lines, then all removed lines
and finally all added lines.  If the diff output consisted of mixed added
and removed lines, gitweb would reorder these lines.  This is true for
combined diff output, for example:

	 - removed line for first parent
	 + added line for first parent
	  -removed line for second parent
	 ++added line for both parents

would be rendered as:

	- removed line for first parent
	 -removed line for second parent
	+ added line for first parent
	++added line for both parents

To prevent gitweb from reordering lines, print_diff_chunk() calls
print_diff_lines() as soon as it detects that both added and removed
lines are present and there was a class change.

Signed-off-by: Michał Kiedrowicz <michal.kiedrowicz@gmail.com>
601acca
gitweb: Move HTML-formatting diff line back to process_diff_line()
Commit 6ba1eb5 (gitweb: Add a feature to show side-by-side diff,
2011-10-31) for no special reason moved wrapping diff line in <div> out
of format_diff_line(). Bring back old behavior.

This simplifies code in git_patchset_body() and keeps formatting of a
diff line in one place.

The more long-term purpose of this patch is to move formatting diff
lines down to print_diff_chunk(), to allow processing lines without
HTML-formatting.

This is just a refactoring patch. It's not meant to change gitweb
output.

Signed-off-by: Michał Kiedrowicz <michal.kiedrowicz@gmail.com>
Acked-by: Jakub Narębski <jnareb@gmail.com>
8c5e8f3
gitweb: Push formatting diff lines to print_diff_chunk()
Now git_patchset_body() only calls diff_line_class(), which is removed
from process_diff_line(). The latter function is renamed to
format_diff_line() and its output is changed to return only
HTML-formatted line, which brings it in line with outher format_*
subroutined.

This slightly changes the order of operations performed on diff lines.
Before this commit, each read line was formatted and then put to the
@chunk accumulator. Now, lines are formatted inside print_diff_chunk(),

This is a preparation patch for diff refinement highlightning. It's not
meant to change gitweb output.

Signed-off-by: Michał Kiedrowicz <michal.kiedrowicz@gmail.com>
Acked-by: Jakub Narębski <jnareb@gmail.com>
a5aa93a
gitweb: Highlight interesting parts of diff
Reading diff output is sometimes very hard, even if it's colored,
especially if lines differ only in few characters.  This is often true
when a commit fixes a typo or renames some variables or functions.

This commit teaches gitweb to highlight characters that are different
between old and new line with a light green/red background.  This should
work in the similar manner as in Trac or GitHub.

The algorithm that compares lines is based on contrib/diff-highlight.
Basically, it works by determining common prefix/suffix of corresponding
lines and highlightning only the middle part of lines.  For more
information, see contrib/diff-highlight/README.

Combined diffs are not supported but a following commit will change it.

Two changes in format_diff_line() were needed to allow diff refinement
highlightning to work.  Firstly, format_diff_line() was taught to not
esc_html() line that was passed as a reference.  This was needed because
refining the highlight must be performed on unescaped lines and it uses
a <span> element to mark interesting parts of the line.  Secondly, the
lines are untabified before comparing because calling untabify()
after inserting <span>'s could improperly convert tabs to spaces.

Signed-off-by: Michał Kiedrowicz <michal.kiedrowicz@gmail.com>
59dce08
gitweb: Refinement highlightning in combined diffs
The highlightning of combined diffs is currently disabled.  This is
because output from a combined diff is much harder to highlight because
it's not obvious which removed and added lines should be compared.

Moreover, code that compares added and removed lines doesn't care about
combined diffs. It only skips first +/- character, treating second +/-
as a line content.

Let's start with a simple case: only highlight changes that come from
one parent, i.e. when every removed line has a corresponding added line
for the same parent.  This way the highlightning cannot get wrong. For
example, following diffs would be highlighted:

	- removed line for first parent
	+ added line for first parent
	  context line
	 -removed line for second parent
	 +added line for second parent

or

	- removed line for first parent
	 -removed line for second parent
	+ added line for first parent
	 +added line for second parent

but following output will not:

	- removed line for first parent
	 -removed line for second parent
	 +added line for second parent
	++added line for both parents

Further changes may introduce more intelligent approach that better
handles combined diffs.

Signed-off-by: Michał Kiedrowicz <michal.kiedrowicz@gmail.com>
60b0647
Tim Henigan difftool: print list of valid tools with '--tool-help'
Since bc7a96a (mergetool--lib: Refactor tools into separate files,
2011-08-18), it is possible to add a new diff tool by creating a simple
script in the '$(git --exec-path)/mergetools' directory.  Updating the
difftool help text is still a manual process, and the documentation can
easily go out of sync.

This commit teaches difftool the '--tool-help' option, which:
  - Reads the list of valid tools from 'mergetools/*'
  - Determines which of them are actually installed
  - Determines which are capable of diffing (i.e. not just a merge tool)
  - Prints the resulting list for the user

Signed-off-by: Tim Henigan <tim.henigan@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4e45b29
Mar 30, 2012
Teach revision walking machinery to walk multiple times sequencially
Previously it was not possible to iterate revisions twice using the
revision walking api. We add a reset_revision_walk() which clears the
used flags. This allows us to do multiple sequencial revision walks.

We add the appropriate calls to the existing submodule machinery doing
revision walks. This is done to avoid surprises if future code wants to
call these functions more than once during the processes lifetime.

Signed-off-by: Heiko Voigt <hvoigt@hvoigt.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
bcc0a3e
Refactor submodule push check to use string list instead of integer
This allows us to tell the user which submodules have not been pushed.
Additionally this is helpful when we want to automatically try to push
submodules that have not been pushed.

Signed-off-by: Heiko Voigt <hvoigt@hvoigt.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
a762e51
push: teach --recurse-submodules the on-demand option
When using this option git will search for all submodules that
have changed in the revisions to be send. It will then try to
push the currently checked out branch of each submodule.

This helps when a user has finished working on a change which
involves submodules and just wants to push everything in one go.

Signed-off-by: Fredrik Gustafsson <iveqy@iveqy.com>
Mentored-by: Jens Lehmann <Jens.Lehmann@web.de>
Mentored-by: Heiko Voigt <hvoigt@hvoigt.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
eb21c73
string-list: document that string_list_insert() inserts unique strings
Signed-off-by: Heiko Voigt <hvoigt@hvoigt.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
b8939b2
gitweb: add `status` headers to git_feed() responses.
The git_feed() method was not setting a `Status` header unless it was
responding to an If-Modified-Since request with `304 Not Modified`.
Now, when it is serving successful responses, it sets status to `200
OK`.

Signed-off-by: W Trevor King <wking@drexel.edu>
Acked-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
e1c3643
gitweb: refactor If-Modified-Since handling
The current gitweb only generates Last-Modified and handles
If-Modified-Since headers for the git_feed action.  This patch breaks
the Last-Modified and If-Modified-Since handling code out from
git_feed into a new function exit_if_unmodified_since.  This makes the
code easy to reuse for other actions.

Only gitweb actions which can easily calculate a modification time
should use exit_if_unmodified_since, as the goal is to balance local
processing time vs. upload bandwidth.

Signed-off-by: W Trevor King <wking@drexel.edu>
Acked-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
b7d565e
gitweb: add If-Modified-Since handling to git_snapshot().
Because snapshots can be large, you can save some bandwidth by
supporting caching via If-Modified-Since.  This patch adds support for
the i-m-s request to git_snapshot() if the request is a commit.
Requests for snapshots of trees, which lack well defined timestamps,
are still handled as they were before.

Signed-off-by: W Trevor King <wking@drexel.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
8745db6
Jeff King http-backend: respect existing GIT_COMMITTER_* variables
The http-backend program sets default GIT_COMMITTER_NAME and
GIT_COMMITTER_EMAIL variables based on the REMOTE_USER and
REMOTE_ADDR variables provided by the webserver. However, it
unconditionally overwrites any existing GIT_COMMITTER
variables, which may have been customized by site-specific
code in the webserver (or in a script wrapping http-backend).

Let's leave those variables intact if they already exist,
assuming that any such configuration was intentional. There
is a slight chance of a regression if somebody has set
GIT_COMMITTER_* for the entire webserver, not intending it
to leak through http-backend. We could protect against this
by passing the information in alternate variables.  However,
it seems unlikely that anyone will care about that
regression, and there is value in the simplicity of using
the common variable names that are used elsewhere in git.

While we're tweaking the environment-handling in
http-backend, let's switch it to use argv_array to handle
the list of variables. That makes the memory management much
simpler.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
e32a458
Jeff King run-command: treat inaccessible directories as ENOENT
When execvp reports EACCES, it can be one of two things:

  1. We found a file to execute, but did not have
     permissions to do so.

  2. We did not have permissions to look in some directory
     in the $PATH.

In the former case, we want to consider this a
permissions problem and report it to the user as such (since
getting this for something like "git foo" is likely a
configuration error).

In the latter case, there is a good chance that the
inaccessible directory does not contain anything of
interest. Reporting "permission denied" is confusing to the
user (and prevents our usual "did you mean...?" lookup). It
also prevents git from trying alias lookup, since we do so
only when an external command does not exist (not when it
exists but has an error).

This patch detects EACCES from execvp, checks whether we are
in case (2), and if so converts errno to ENOENT. This
behavior matches that of "bash" (but not of simpler shells
that use execvp more directly, like "dash").

Test stolen from Junio.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
b0984f8
Junio C Hamano t7501: test the right kind of breakage
These tests try to run "git commit" with various "forbidden" combinations
of options and expect the command to fail, but they do so without having
any change added to the index.  We wouldn't be able to catch breakages
that would allow these combinations by mistake with them because the
command will fail with "nothing to commit" anyway.

Make sure we have something added to the index before running the command.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
c65dc35
Junio C Hamano commit: do not trigger bogus "has templated message edited" check
When "-t template" and "-F msg" options are both given (or worse yet,
there is "commit.template" configuration but a message is given in some
other way), the documentation says that template is ignored.  However,
the "has the user edited the message?" check still used the contents of
the template file as the basis of the emptyness check.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
010c7db
Junio C Hamano commit: rephrase the error when user did not touch templated log message
When the user exited editor without editing the commit log template given
by "git commit -t <template>", the commit was aborted (correct) with an
error message that said "due to empty commit message" (incorrect).

This was because the original template support was done by piggybacking on
the check to detect an empty log message.  Split the codepaths into two
independent checks to clarify the error.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
b2eda9b
Junio C Hamano push: detect nonsense "upstream" check more carefully
The user can say "git push" without specifying any refspec.  When using
"upstream" semantics via the push.default configuration, the user wants to
update the "upstream" branch, which is the branch at a remote repository
the current branch is set to integrate with, with this command.

There are cases that "git push" do not make sense when push.default is set
to "upstream":

 - The current branch does not have branch.$name.remote configured.  By
   definition, "git push" that does not name where to push to will not
   know where to push to.  The user may explicitly say "git push $there",
   but again, by definition, no branch at repository $there is set to
   integrate with the current branch in this case and we wouldn't know
   which remote branch to update.

 - The current branch does have branch.$name.remote configured, but it
   does not specify branch.$name.merge that names what branch at the
   remote this branch integrates with. "git push" knows where to push in
   this case (or the user may explicitly say "git push $remote" to tell us
   where to push), but we do not know which remote branch to update.

 - The current branch does have both branch.$name.remote and
   branch.$name.merge configured, but the user said "git push $there",
   where $there does not match what "branch.$name.remote" is configured
   to.  By definition, no branch at repository $there is set to integrate
   with the current branch in this case and we wouldn't know which remote
   branch to update.

The first two cases were already checked correctly, but the third case was
not checked and we ended up updating the branch named branch.$name.merge
at repository $there, which was totally bogus.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
d08807b
Junio C Hamano Merge branch 'maint'
* maint:
  string-list: document that string_list_insert() inserts unique strings
19a6cd3
Junio C Hamano Merge branch 'da/difftool-test' into jch
Makes sure "difftool" options can be given in any order.

* da/difftool-test:
  t7800: Test difftool passing arguments to diff
98253f5
Junio C Hamano Merge branch 'jn/diffstat-tests' into jch
Some tests checked the "diff --stat" output when they do not have to,
which unnecessarily made things harder to verify under GETTEXT_POISON.

Not urgent.

* jn/diffstat-tests:
  diffstat summary line varies by locale: miscellany
  test: use numstat instead of diffstat in binary-diff test
  test: use --numstat instead of --stat in "git stash show" tests
  test: test cherry-pick functionality and output separately
  test: modernize funny-names test style
  test: use numstat instead of diffstat in funny-names test
  test: use test_i18ncmp when checking --stat output
bc24fb8
Junio C Hamano Merge branch 'jc/commit-hook-authorship' into jch
"git commit --author=$name" did not tell the name that was being
recorded in the resulting commit to hooks, even though it does do so
when the end user overrode the authorship via the "GIT_AUTHOR_NAME"
environment variable.  This is a simpler of the two approaches.

Will defer til 1.7.10.

* jc/commit-hook-authorship:
  commit: pass author/committer info to hooks
  t7503: does pre-commit-hook learn authorship?
  ident.c: add split_ident_line() to parse formatted ident line
63d94a1
Junio C Hamano Merge branch 'tr/maint-word-diff-regex-sticky' into jch
The regexp configured with wordregex was incorrectly reused across
files.
Not urgent.

* tr/maint-word-diff-regex-sticky:
  diff: tweak a _copy_ of diff_options with word-diff
  diff: refactor the word-diff setup from builtin_diff_cmd
  t4034: diff.*.wordregex should not be "sticky" in --word-diff
693cf32
Junio C Hamano Merge branch 'jh/notes-merge-in-git-dir-worktree' into jch
Running "notes merge --commit" failed to perform correctly when run
from any directory inside $GIT_DIR/.  When "notes merge" stops with
conflicts, $GIT_DIR/NOTES_MERGE_WORKTREE is the place a user edits
to resolve it.

Not urgent.

* jh/notes-merge-in-git-dir-worktree:
  notes-merge: Don't remove .git/NOTES_MERGE_WORKTREE; it may be the user's cwd
  notes-merge: use opendir/readdir instead of using read_directory()
  t3310: illustrate failure to "notes merge --commit" inside $GIT_DIR/
  remove_dir_recursively(): Add flag for skipping removal of toplevel dir
c490819
Junio C Hamano Merge branch 'jc/maint-clean-nested-worktree-in-subdir' into jch
"git clean -d -f" (not "-d -f -f") is supposed to protect nested working
trees of independent git repositories that exist in the current project
working tree from getting removed, but the protection applied only to such
working trees that are at the top-level of the current project by mistake.

Not urgent.

* jc/maint-clean-nested-worktree-in-subdir:
  clean: preserve nested git worktree in subdirectories
e99c896
Junio C Hamano Merge branch 'rs/unpack-trees-leakfix' into jch
Will defer til 1.7.10.

* rs/unpack-trees-leakfix:
  unpack-trees: plug minor memory leak
dcb9d49
Junio C Hamano Merge branch 'jc/diff-algo-cleanup' into jch
Resurrects the preparatory clean-up patches from another topic that was
discarded, as this would give a saner foundation to build on diff.algo
configuration option series.

Not urgent.

* jc/diff-algo-cleanup:
  xdiff: PATIENCE/HISTOGRAM are not independent option bits
  xdiff: remove XDL_PATCH_* macros
c578463
Junio C Hamano Merge branch 'nd/stream-more' into jch
Use API to read blob data in smaller chunks in more places to
reduce the memory footprint.  In general, looked fairly good.

Will defer til 1.7.10.

* nd/stream-more:
  update-server-info: respect core.bigfilethreshold
  fsck: use streaming API for writing lost-found blobs
  show: use streaming API for showing blobs
  parse_object: avoid putting whole blob in core
  cat-file: use streaming API to print blobs
  Add more large blob test cases
  streaming: make streaming-write-entry to be more reusable
c351bf4
Junio C Hamano Merge branch 'zj/test-cred-helper-nicer-prove' into jch
Minor improvement to t0303.
Not urgent.

* zj/test-cred-helper-nicer-prove:
  t0303: resurrect commit message as test documentation
  t0303: immediately bail out w/o GIT_TEST_CREDENTIAL_HELPER
fe5cc9a
Junio C Hamano Merge branch 'nl/rebase-i-cheat-sheet' into jch
Not urgent.

* nl/rebase-i-cheat-sheet:
  rebase -i: remind that the lines are top-to-bottom
18ebe57
Junio C Hamano Merge branch 'nl/http-proxy-more' into jch
The code to talk to http proxies learn to use the same credential
API used to talk to the final http destinations.

Will defer til 1.7.10.

* nl/http-proxy-more:
  http: rename HTTP_REAUTH to HTTP_AUTH_RETRY
  http: Avoid limit of retrying request only twice
  http: handle proxy authentication failure (error 407)
  http: handle proxy proactive authentication
  http: try http_proxy env var when http.proxy config option is not set
124a44d
Junio C Hamano Merge branch 'ct/advise-push-default' into jch
Breaks down the cases in which "git push" fails due to non-ff into three
categories, and gives separate advise messages.  This should be a good
change regardless of mm/push-default-switch-warning topic.

* ct/advise-push-default:
  clean up struct ref's nonfastforward field
  push: Provide situational hints for non-fast-forward errors
bf80479
Junio C Hamano Merge branch 'mm/push-default-switch-warning' into jch
Not urgent.

This resurrects an ancient patch I wrote during a discussion we had in the
1.6.3-1.6.4 era.  This should probably come after ct/advise-push-default
topic and at that point the advise messages need to be rephrased, taking
the future default change into account.

* mm/push-default-switch-warning:
  push: start warning upcoming default change for push.default

Conflicts:
	builtin/push.c
71cd528
Junio C Hamano Merge branch 'jk/diff-no-rename-empty' into pu
Forbids rename detection logic from matching two empty files as renames
during merge-recursive to prevent mismerges.

* jk/diff-no-rename-empty:
  merge-recursive: don't detect renames of empty files
  teach diffcore-rename to optionally ignore empty content
  make is_empty_blob_sha1 available everywhere
  drop casts from users EMPTY_TREE_SHA1_BIN
a3d7225
Junio C Hamano Merge branch 'rs/combine-diff-zero-context-at-the-beginning' into pu
Fixes an age old corner case bug in combine diff (only triggered with -U0
and the hunk at the beginning of the file needs to be shown).

* rs/combine-diff-zero-context-at-the-beginning:
  combine-diff: fix loop index underflow
5b105c9
Junio C Hamano Merge branch 'jc/commit-unedited-template' into pu
* jc/commit-unedited-template:
  commit: rephrase the error when user did not touch templated log message
  commit: do not trigger bogus "has templated message edited" check
  t7501: test the right kind of breakage
1e1e71a
Junio C Hamano Merge branch 'jk/http-backend-keep-committer-ident-env' into pu
* jk/http-backend-keep-committer-ident-env:
  http-backend: respect existing GIT_COMMITTER_* variables
5c8d7f3
Junio C Hamano Merge branch 'jc/push-upstream-sanity' into pu
* jc/push-upstream-sanity:
  push: detect nonsense "upstream" check more carefully
154d8d1
Junio C Hamano Merge branch 'jk/branch-quiet' into pu
Even with "-q"uiet option, "checkout" used to report setting up tracking.
Also "branch" learns "-q"uiet option to squelch informational message.

* jk/branch-quiet:
  teach "git branch" a --quiet option
  checkout: suppress tracking message with "-q"
97d6c81
Junio C Hamano Merge branch 'jc/run-hook-env-1' into pu
Not urgent.

Updates run_hook() API to be much less specific to "commit".  It would
only be useful if people start doing more interesting things with hooks.

* jc/run-hook-env-1:
  run_hook(): enhance the interface to pass arbitrary environment
7b83ec0
Junio C Hamano Merge branch 'sl/autoconf' into pu
Updates our configure.ac to follow a better "autoconf" style.

* sl/autoconf:
  configure: be more idiomatic
  configure: avoid some code repetitions thanks to m4_{push,pop}def
  configure: move definitions of private m4 macros before AC_INIT invocation
b72b53e
Junio C Hamano Merge branch 'th/difftool-diffall' into pu
Rolls the two-directory-diff logic from diffall script (in contrib/) into
"git difftool" framework.

* th/difftool-diffall:
  difftool: print list of valid tools with '--tool-help'
  difftool: teach difftool to handle directory diffs
  difftool: replace system call with Git::command_noisy
  difftool: eliminate setup_environment function
  difftool: stop appending '.exe' to git
  difftool: remove explicit change of PATH
  difftool: exit(0) when usage is printed
  difftool: add '--no-gui' option
  difftool: parse options using Getopt::Long
eb8e5c5
Junio C Hamano Merge branch 'jb/am-include' into pu
* jb/am-include:
  am: support --include option
9e7a2fb
Junio C Hamano Merge branch 'jc/am-report-3way' into pu
* jc/am-report-3way:
  am -3: list the paths that needed 3-way fallback
31da0f9
Junio C Hamano Merge branch 'jc/fmt-merge-msg-people' into pu
The "fmt-merge-msg" command learns to list the primary contributors
involved in the side topic you are merging.

Will defer til 1.7.10.

* jc/fmt-merge-msg-people:
  fmt-merge-msg: show those involved in a merged series
df2aa45
Junio C Hamano Merge branch 'jk/run-command-eacces' into pu
When PATH contains an unreadable directory, alias expansion code did not
kick in, and failed with an error that said "git-subcmd" was not found.

* jk/run-command-eacces:
  run-command: treat inaccessible directories as ENOENT
5b71cd7
Junio C Hamano Merge branch 'jh/apply-free-patch' into pu
Valgrind reports quite a lot of discarded memory inside apply.  I started
auditing the memory ownership rules in the command, and am almost done.

Will defer til 1.7.10.

* jh/apply-free-patch:
  apply.c: WIP ownership audit
  apply: free unused fragments for submodule patch
  apply: free patch->result
  apply: release memory for fn_table
  apply: free patch->{def,old,new}_name fields
  apply: rename free_patch() to free_patch_list()
  apply: do not leak patches and fragments
288dfac
Junio C Hamano Merge branch 'jc/maint-merge-autoedit' into pu
In 1.7.10, we added GIT_MERGE_AUTOEDIT=no environment variable to help
older scripts to let them refuse giving users a chance to explain the
merge, but forgot that 1.7.9 automatically opens an editor when merging an
annotated tag, and there is no equivalent escape hatch.  A merge of this
topic to 1.7.10 track becomes a no-op, but we may want to apply this to
the 1.7.9.x series.

* jc/maint-merge-autoedit:
  merge: backport GIT_MERGE_AUTOEDIT support

Conflicts:
	Documentation/merge-options.txt
d64740c
Junio C Hamano Merge branch 'ss/git-svn-prompt-sans-terminal' into pu
The bottom one has been replaced with a rewrite based on comments
from Ævar. The second one needs more work, both in perl/Git.pm and
prompt.c, to give precedence to tty over SSH_ASKPASS when terminal
is available.

* ss/git-svn-prompt-sans-terminal:
  fixup! 15eaaf4
  git-svn, perl/Git.pm: extend Git::prompt helper for querying users
  perl/Git.pm: "prompt" helper to honor GIT_ASKPASS and SSH_ASKPASS
2f9f0d1
Junio C Hamano Merge branch 'hv/submodule-recurse-push' into pu
The bottom one was not clearly explained and needs a reroll.

* hv/submodule-recurse-push:
  push: teach --recurse-submodules the on-demand option
  Refactor submodule push check to use string list instead of integer
  Teach revision walking machinery to walk multiple times sequencially

Conflicts:
	transport.h
399c851
Junio C Hamano Merge branch 'nd/columns' into pu
Rerolled again.  Modulo minor nits, looked nicer than the previous round.

* nd/columns:
  column: support grouping entries
  column: support "denser" mode
  ls-files: support --column
  tag: add --column
  column: support piping stdout to external git-column process
  status: add --column
  branch: add --column
  help: reuse print_columns() for help -a
  column: add dense layout support
  column: add columnar layout
  Stop starting pager recursively
  Add column layout skeleton and git-column

Conflicts:
	builtin/branch.c
5646256
Junio C Hamano Merge branch 'lp/maint-diff-three-dash-with-graph' into pu
The combination of two options "log --graph --stat" was an obscure corner
case nobody cared about, and did not correctly show the ancestry graph
lines.

I've split the original patch into three pieces, one for fixes to two
different issues and a test.  Also the test is adjusted so that the series
can be back-merged to older codebase that did not have 7f81463 (Use
correct grammar in diffstat summary line, 2012-02-01) that first appeared
in v1.7.9.2

With a review from Zbigniew, I would expect that this would be rerolled
again.

* lp/maint-diff-three-dash-with-graph:
  t4202: add test for "log --graph --stat -p" separator lines
  log --graph: fix break in graph lines
  log --graph --stat: three-dash separator should come after graph lines
b93533b
Junio C Hamano Merge branch 'nd/threaded-index-pack' into pu
Another reroll after a bugreport on pthread usage discovered by Ramsey,
but it seems the topic is cooking between Ramsay and Duy out of tree.
Waiting for resolution.

* nd/threaded-index-pack:
  index-pack: support multithreaded delta resolving
  index-pack: split second pass obj handling into own function
fa5ce8d
Junio C Hamano Merge branch 'wk/gitweb-snapshot-use-if-modified-since' into pu
Makes 'snapshot' request to "gitweb" honor If-Modified-Since: header,
based on the commit date.

* wk/gitweb-snapshot-use-if-modified-since:
  gitweb: add If-Modified-Since handling to git_snapshot().
  gitweb: refactor If-Modified-Since handling
  gitweb: add `status` headers to git_feed() responses.
24712bc
Junio C Hamano Merge branch 'jc/split-blob' into pu
Not ready.

I finished the streaming checkout codepath, but as explained in
127b177 (bulk-checkin: support chunked-object encoding, 2011-11-30),
these are still early steps of a long and painful journey. At least
pack-objects and fsck need to learn the new encoding for the series
to be usable locally, and then index-pack/unpack-objects needs to
learn it to be used remotely.

Given that I heard a lot of noise that people want large files, and
that I was asked by somebody at GitTogether'11 privately for an
advice on how to pay developers (not me) to help adding necessary
support, I am somewhat dissapointed that the original patch series
that was sent almost two months ago still remains here without much
comments and updates from the developer community. I even made the
interface to the logic that decides where to split chunks easily
replaceable, and I deliberately made the logic in the original patch
extremely stupid to entice others, especially the "bup" fanboys, to
come up with a better logic, thinking that giving people an easy
target to shoot for, they may be encouraged to help out. The plan is
not working :-(.

* jc/split-blob:
  chunked-object: streaming checkout
  chunked-object: fallback checkout codepaths
  bulk-checkin: support chunked-object encoding
  bulk-checkin: allow the same data to be multiply hashed
  new representation types in the packstream
  varint-in-pack: refactor varint encoding/decoding

Conflicts:
	t/t1050-large.sh
4124107
Junio C Hamano Merge branch 'dg/subtree' into pu
A test merge of the 'subtree'.

* dg/subtree: (108 commits)
  Add Subtree Test Makefile
  Build Subtree
  Use Project Config Files
  Remove Unneeded Files
  Set TEST_DIRECTORY
  Use Test Harness
  Rename Test
  Move Tests Into Subdirectory
  Skip commit objects that should be trees, rather than copying them.
  It's also okay if an expected tree object is actually a commit.
  Added check to order of processed commits.
  Split cmd now processes commits in topo order.
  Fix a few typos/grammar-o's in the preceding commit.
  docs: Description, synopsys, options and examples changes.
  Fixing eval syntax error.
  Fix typo: an -> a
  docs: simplify example 1
  Another fix for PATH and msysgit.
  (Hopefully) fix PATH setting for msysgit.
  Fixed regression with splitting out new subtree
  ...
8030fae
Use SHELL_PATH from build system in run_command.c:prepare_shell_cmd
During the testing of the 1.7.10 rc series on Solaris for OpenCSW, it
was discovered that t7006-pager was failing due to finding a bad "sh"
in PATH after a call to execvp("sh", ...).  This call was setup by
run_command.c:prepare_shell_cmd.

The PATH in use at the time saw /opt/csw/bin given precedence to
traditional Solaris paths such as /usr/bin and /usr/xpg4/bin.  A
package named schilyutils (Joerg Schilling's utilities) was installed
on the build system and it delivered a modified version of the
traditional Solaris /usr/bin/sh as /opt/csw/bin/sh.  This version of
sh suffers from many of the same problems as /usr/bin/sh.

The command-specific pager test failed due to the broken "sh" handling
^ as a pipe character.  It tried to fork two processes when it
encountered "sed s/^/foo:/" as the pager command.  This problem was
entirely dependent on the PATH of the user at runtime.

Possible fixes for this issue are:

1. Use the standard system() or popen() which both launch a POSIX
   shell on Solaris as long as _POSIX_SOURCE is defined.

2. The git wrapper could prepend SANE_TOOL_PATH to PATH thus forcing
   all unqualified commands run to use the known good tools on the
   system.

3. The run_command.c:prepare_shell_command() could use the same
   SHELL_PATH that is in the #! line of all all scripts and not rely
   on PATH to find the sh to run.

Option 1 would preclude opening a bidirectional pipe to a filter
script and would also break git for Windows as cmd.exe is spawned from
system() (cf. v1.7.5-rc0~144^2, "alias: use run_command api to execute
aliases, 2011-01-07).

Option 2 is not friendly to users as it would negate their ability to
use tools of their choice in many cases.  Alternately, injecting
SANE_TOOL_PATH such that it takes precedence over /bin and /usr/bin
(and anything with lower precedence than those paths) as
git-sh-setup.sh does would not solve the problem either as the user
environment could still allow a bad sh to be found.  (Many OpenCSW
users will have /opt/csw/bin leading their PATH and some subset would
have schilyutils installed.)

Option 3 allows us to use a known good shell while still honouring the
users' PATH for the utilities being run.  Thus, it solves the problem
while not negatively impacting either users or git's ability to run
external commands in convenient ways.  Essentially, the shell is a
special case of tool that should not rely on SANE_TOOL_PATH and must
be called explicitly.

With this patch applied, any code path leading to
run_command.c:prepare_shell_cmd can count on using the same sane shell
that all shell scripts in the git suite use.  Both the build system
and run_command.c will default this shell to /bin/sh unless
overridden.

Signed-off-by: Ben Walton <bwalton@artsci.utoronto.ca>
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
30678bc
Junio C Hamano Merge branch 'bw/spawn-via-shell-path' into pu
"sh" on the user's PATH may be utterly broken on some systems;
consistently use SHELL_PATH even from inside run-command API.

* bw/spawn-via-shell-path:
  Use SHELL_PATH from build system in run_command.c:prepare_shell_cmd
287ca4e
Junio C Hamano Merge branch 'mk/gitweb-diff-hl' into pu
* mk/gitweb-diff-hl:
  gitweb: Refinement highlightning in combined diffs
  gitweb: Highlight interesting parts of diff
  gitweb: Push formatting diff lines to print_diff_chunk()
  gitweb: Move HTML-formatting diff line back to process_diff_line()
  gitweb: Use print_diff_chunk() for both side-by-side and inline diffs
  gitweb: Extract print_sidebyside_diff_lines()
  gitweb: Pass esc_html_hl_regions() options to esc_html()
  gitweb: esc_html_hl_regions(): Don't create empty <span> elements
ae98c93
Apr 02, 2012
Marco Sousa l10n: Inital Portuguese Portugal language (pt_PT)
Signed-off-by: Marco Sousa <marcomsousa@gmail.com>
e0769ab
Something went wrong with that request. Please try again.