gitweb.git
Merge branch 'jl/maint-pull-tags-doc'Junio C Hamano Wed, 17 Nov 2010 23:02:35 +0000 (15:02 -0800)

Merge branch 'jl/maint-pull-tags-doc'

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

Merge branch 'kb/maint-submodule-savearg'Junio C Hamano Wed, 17 Nov 2010 23:02:12 +0000 (15:02 -0800)

Merge branch 'kb/maint-submodule-savearg'

* kb/maint-submodule-savearg:
submodule: only preserve flags across recursive status/update invocations
submodule: preserve all arguments exactly when recursing

Merge branch 'jk/missing-config'Junio C Hamano Wed, 17 Nov 2010 23:02:08 +0000 (15:02 -0800)

Merge branch 'jk/missing-config'

* jk/missing-config:
config: treat non-existent config files as empty

Merge branch 'kb/maint-diff-ws-check'Junio C Hamano Wed, 17 Nov 2010 23:01:47 +0000 (15:01 -0800)

Merge branch 'kb/maint-diff-ws-check'

* kb/maint-diff-ws-check:
diff: handle lines containing only whitespace and tabs better
test-lib: extend test_decode_color to handle more color codes

Merge branch 'bg/maint-gitweb-test-lib'Junio C Hamano Wed, 17 Nov 2010 23:01:37 +0000 (15:01 -0800)

Merge branch 'bg/maint-gitweb-test-lib'

* bg/maint-gitweb-test-lib:
t/gitweb-lib: Don't pass constant to decode_utf8

Conflicts:
t/gitweb-lib.sh

Merge branch 'jm/mailmap'Junio C Hamano Wed, 17 Nov 2010 23:01:26 +0000 (15:01 -0800)

Merge branch 'jm/mailmap'

* jm/mailmap:
t4203: do not let "git shortlog" DWIM based on tty
t4203 (mailmap): stop hardcoding commit ids and dates
mailmap: fix use of freed memory

Merge branch 'tr/maint-git-repack-tmpfile'Junio C Hamano Wed, 17 Nov 2010 23:01:23 +0000 (15:01 -0800)

Merge branch 'tr/maint-git-repack-tmpfile'

* tr/maint-git-repack-tmpfile:
repack: place temporary packs under .git/objects/pack/

Merge branch 'jk/maint-apply-no-binary'Junio C Hamano Wed, 17 Nov 2010 23:01:18 +0000 (15:01 -0800)

Merge branch 'jk/maint-apply-no-binary'

* jk/maint-apply-no-binary:
apply: don't segfault on binary files with missing data

Merge branch 'jk/push-progress'Junio C Hamano Wed, 17 Nov 2010 23:01:00 +0000 (15:01 -0800)

Merge branch 'jk/push-progress'

* jk/push-progress:
push: pass --progress down to git-pack-objects
t5523-push-upstream: test progress messages
t5523-push-upstream: add function to ensure fresh upstream repo
test_terminal: ensure redirections work reliably
test_terminal: catch use without TTY prerequisite
test-lib: allow test code to check the list of declared prerequisites
tests: test terminal output to both stdout and stderr
tests: factor out terminal handling from t7006

Merge branch 'tr/maint-merge-file-subdir'Junio C Hamano Wed, 17 Nov 2010 23:00:56 +0000 (15:00 -0800)

Merge branch 'tr/maint-merge-file-subdir'

* tr/maint-merge-file-subdir:
merge-file: correctly find files when called in subdir
prefix_filename(): safely handle the case where pfx_len=0

Merge branch 'jn/send-pack-error'Junio C Hamano Wed, 17 Nov 2010 23:00:51 +0000 (15:00 -0800)

Merge branch 'jn/send-pack-error'

* jn/send-pack-error:
send-pack: avoid redundant "pack-objects died with strange error"

Merge branch 'mg/make-prove'Junio C Hamano Wed, 17 Nov 2010 23:00:46 +0000 (15:00 -0800)

Merge branch 'mg/make-prove'

* mg/make-prove:
test: allow running the tests under "prove"

Merge branch 'kb/completion-checkout'Junio C Hamano Wed, 17 Nov 2010 23:00:42 +0000 (15:00 -0800)

Merge branch 'kb/completion-checkout'

* kb/completion-checkout:
completion: Support the DWIM mode for git checkout

Merge branch 'sg/completion'Junio C Hamano Wed, 17 Nov 2010 23:00:11 +0000 (15:00 -0800)

Merge branch 'sg/completion'

* sg/completion:
bash: support pretty format aliases
bash: support more 'git notes' subcommands and their options
bash: not all 'git bisect' subcommands make sense when not bisecting
bash: offer refs for 'git bisect start'

Merge branch 'sg/bisect'Junio C Hamano Wed, 17 Nov 2010 23:00:03 +0000 (15:00 -0800)

Merge branch 'sg/bisect'

* sg/bisect:
bisect: check for mandatory argument of 'bisect replay'
bisect: improve error msg of 'bisect reset' when original HEAD is deleted
bisect: improve error message of 'bisect log' while not bisecting

Merge branch 'ak/submodule-sync'Junio C Hamano Wed, 17 Nov 2010 22:59:54 +0000 (14:59 -0800)

Merge branch 'ak/submodule-sync'

* ak/submodule-sync:
submodule sync: Update "submodule.<name>.url" for empty directories

Merge branch 'jk/maint-rev-list-nul'Junio C Hamano Wed, 17 Nov 2010 22:59:33 +0000 (14:59 -0800)

Merge branch 'jk/maint-rev-list-nul'

* jk/maint-rev-list-nul:
rev-list: handle %x00 NUL in user format

Merge branch 'ks/no-textconv-symlink'Junio C Hamano Wed, 17 Nov 2010 22:59:27 +0000 (14:59 -0800)

Merge branch 'ks/no-textconv-symlink'

* ks/no-textconv-symlink:
blame,cat-file --textconv: Don't assume mode is ``S_IFREF | 0664''
blame,cat-file: Demonstrate --textconv is wrongly running converter on symlinks
blame,cat-file: Prepare --textconv tests for correctly-failing conversion program

Merge branch 'jn/gitweb-test'Junio C Hamano Wed, 17 Nov 2010 22:59:22 +0000 (14:59 -0800)

Merge branch 'jn/gitweb-test'

* jn/gitweb-test:
gitweb/Makefile: Include gitweb/config.mak
gitweb/Makefile: Add 'test' and 'test-installed' targets
t/gitweb-lib.sh: Add support for GITWEB_TEST_INSTALLED
gitweb: Move call to evaluate_git_version after evaluate_gitweb_config

Merge branch 'cb/diff-fname-optim'Junio C Hamano Wed, 17 Nov 2010 22:59:16 +0000 (14:59 -0800)

Merge branch 'cb/diff-fname-optim'

* cb/diff-fname-optim:
diff: avoid repeated scanning while looking for funcname
do not search functions for patch ID
add rebase patch id tests

Merge branch 'jk/no-textconv-symlink'Junio C Hamano Wed, 17 Nov 2010 22:59:10 +0000 (14:59 -0800)

Merge branch 'jk/no-textconv-symlink'

* jk/no-textconv-symlink:
diff: don't use pathname-based diff drivers for symlinks

Merge branch 'dk/maint-blame-el'Junio C Hamano Wed, 17 Nov 2010 22:59:04 +0000 (14:59 -0800)

Merge branch 'dk/maint-blame-el'

* dk/maint-blame-el:
git-blame.el: Add (require 'format-spec)

Merge branch 'maint'Junio C Hamano Wed, 17 Nov 2010 21:57:58 +0000 (13:57 -0800)

Merge branch 'maint'

* maint:
clean: remove redundant variable baselen
Documentation/git-pull: clarify configuration
Document that rev-list --graph triggers parent rewriting.
clean: avoid quoting twice
document sigchain api
Keep together options controlling the behaviour of diffcore-rename.
t3402: test "rebase -s<strategy> -X<opt>"

t6022: Use -eq not = to test output of wc -lBrian Gernhardt Mon, 8 Nov 2010 21:29:26 +0000 (16:29 -0500)

t6022: Use -eq not = to test output of wc -l

When comparing numbers such as "3" to "$(wc -l)", we should check for
numerical equality using -eq instead of string equality using = because
some implementations of wc output extra whitespace.

Signed-off-by: Brian Gernhardt <brian@gernhardtsoftware.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

clean: remove redundant variable baselenNguyễn Thái Ngọc Duy Mon, 15 Nov 2010 06:42:44 +0000 (13:42 +0700)

clean: remove redundant variable baselen

baselen used to be the result of common_prefix() when it was made
builtin. Since 1d8842d (Add 'fill_directory()' helper function for
directory traversal - 2009-05-14), its value will always be
zero. Remove it because it's no longer variable.

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

Provide 'git merge --abort' as a synonym to 'git reset... Johan Herland Tue, 9 Nov 2010 21:49:59 +0000 (22:49 +0100)

Provide 'git merge --abort' as a synonym to 'git reset --merge'

Teach 'git merge' the --abort option, which verifies the existence of
MERGE_HEAD and then invokes 'git reset --merge' to abort the current
in-progress merge and attempt to reconstruct the pre-merge state.

The reason for adding this option is to provide a user interface for
aborting an in-progress merge that is consistent with the interface
for aborting a rebase ('git rebase --abort'), aborting the application
of a patch series ('git am --abort'), and aborting an in-progress notes
merge ('git notes merge --abort').

The patch includes documentation and testcases that explain and verify
the various scenarios in which 'git merge --abort' can run. The
testcases also document the cases in which 'git merge --abort' is
unable to correctly restore the pre-merge state (look for the '###'
comments towards the bottom of t/t7609-merge-abort.sh).

This patch has been improved by the following contributions:
- Jonathan Nieder: Move test documentation into test_description

Thanks-to: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Johan Herland <johan@herland.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

cmd_merge(): Parse options before checking MERGE_HEADJohan Herland Tue, 9 Nov 2010 21:49:58 +0000 (22:49 +0100)

cmd_merge(): Parse options before checking MERGE_HEAD

Reorder the initial part of builtin/merge.c:cmd_merge() so that command-line
options are parsed _before_ we load the index and check for MERGE_HEAD
(and exits if it exists). This does not change the behaviour of 'git merge',
but is needed in preparation for the implementation of 'git merge --abort'
(which requires MERGE_HEAD to be present).

This patch has been improved by the following contributions:
- Junio C Hamano: fixup minor style issues

Thanks-to: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Johan Herland <johan@herland.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Provide 'git notes get-ref' to easily retrieve current... Johan Herland Tue, 9 Nov 2010 21:49:57 +0000 (22:49 +0100)

Provide 'git notes get-ref' to easily retrieve current notes ref

Script may use 'git notes get-ref' to easily retrieve the current notes ref.

Suggested-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Johan Herland <johan@herland.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

git notes merge: Add testcases for merging notes trees... Johan Herland Tue, 9 Nov 2010 21:49:56 +0000 (22:49 +0100)

git notes merge: Add testcases for merging notes trees at different fanouts

Notes trees may exist at different fanout levels internally. This
implementation detail should not be visible to the user, and it should
certainly not affect the merging of notes tree.

This patch adds testcases verifying the correctness of 'git notes merge'
when merging notes trees at different fanout levels.

This patch has been improved by the following contributions:
- Junio C Hamano: Portability: Don't string-compare 'wc -l' output

Thanks-to: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Johan Herland <johan@herland.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

git notes merge: Add another auto-resolving strategy... Johan Herland Sun, 14 Nov 2010 23:57:17 +0000 (00:57 +0100)

git notes merge: Add another auto-resolving strategy: "cat_sort_uniq"

This new strategy is similar to "concatenate", but in addition to
concatenating the two note candidates, this strategy sorts the resulting
lines, and removes duplicate lines from the result. This is equivalent to
applying the "cat | sort | uniq" shell pipeline to the two note candidates.

This strategy is useful if the notes follow a line-based format where one
wants to avoid duplicate lines in the merge result.

Note that if either of the note candidates contain duplicate lines _prior_
to the merge, these will also be removed by this merge strategy.

The patch also contains tests and documentation for the new strategy.

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

git notes merge: --commit should fail if underlying... Johan Herland Tue, 9 Nov 2010 21:49:54 +0000 (22:49 +0100)

git notes merge: --commit should fail if underlying notes ref has moved

When manually resolving a notes merge, if the merging ref has moved since
the merge started, we should fail to complete the merge, and alert the user
to what's going on.

This situation may arise if you start a 'git notes merge' which results in
conflicts, and you then update the current notes ref (using for example
'git notes add/copy/amend/edit/remove/prune', 'git update-ref', etc.),
before you get around to resolving the notes conflicts and calling
'git notes merge --commit'.

We detect this situation by comparing the first parent of the partial merge
commit (which was created when the merge started) to the current value of the
merging notes ref (pointed to by the .git/NOTES_MERGE_REF symref).

If we don't fail in this situation, the notes merge commit would overwrite
the updated notes ref, thus losing the changes that happened in the meantime.

The patch includes a testcase verifying that we fail correctly in this
situation.

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

git notes merge: List conflicting notes in notes merge... Johan Herland Tue, 9 Nov 2010 21:49:53 +0000 (22:49 +0100)

git notes merge: List conflicting notes in notes merge commit message

This brings notes merge in line with regular merge's behaviour.

This patch has been improved by the following contributions:
- Ævar Arnfjörð Bjarmason: Don't use C99 comments.

Thanks-to: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Johan Herland <johan@herland.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

git notes merge: Manual conflict resolution, part 2/2Johan Herland Tue, 9 Nov 2010 21:49:52 +0000 (22:49 +0100)

git notes merge: Manual conflict resolution, part 2/2

When the notes merge conflicts in .git/NOTES_MERGE_WORKTREE have been
resolved, we need to record a new notes commit on the appropriate notes
ref with the resolved notes.

This patch implements 'git notes merge --commit' which the user should
run after resolving conflicts in the notes merge worktree. This command
finalizes the notes merge by recombining the partial notes tree from
part 1 with the now-resolved conflicts in the notes merge worktree in a
merge commit, and updating the appropriate ref to this merge commit.

In order to correctly finalize the merge, we need to keep track of three
things:

- The partial merge result from part 1, containing the auto-merged notes.
This is now stored into a ref called .git/NOTES_MERGE_PARTIAL.
- The unmerged notes. These are already stored in
.git/NOTES_MERGE_WORKTREE, thanks to part 1.
- The notes ref to be updated by the finalized merge result. This is now
stored in a symref called .git/NOTES_MERGE_REF.

In addition to "git notes merge --commit", which uses the above details
to create the finalized notes merge commit, this patch also implements
"git notes merge --reset", which aborts the ongoing notes merge by simply
removing the files/directory described above.

FTR, "git notes merge --commit" reuses "git notes merge --reset" to remove
the information described above (.git/NOTES_MERGE_*) after the notes merge
have been successfully finalized.

The patch also contains documentation and testcases for the two new options.

This patch has been improved by the following contributions:
- Ævar Arnfjörð Bjarmason: Fix nonsense sentence in --commit description
- Sverre Rabbelier: Rename --reset to --abort

Thanks-to: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Thanks-to: Sverre Rabbelier <srabbelier@gmail.com>
Signed-off-by: Johan Herland <johan@herland.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

git notes merge: Manual conflict resolution, part 1/2Johan Herland Tue, 9 Nov 2010 21:49:51 +0000 (22:49 +0100)

git notes merge: Manual conflict resolution, part 1/2

Conflicts (that are to be resolved manually) are written into a special-
purpose working tree, located at .git/NOTES_MERGE_WORKTREE. Within this
directory, conflicting notes entries are stored (with conflict markers
produced by ll_merge()) using the SHA1 of the annotated object. The
.git/NOTES_MERGE_WORKTREE directory will only contain the _conflicting_
note entries. The non-conflicting note entries (aka. the partial merge
result) are stored in 'local_tree', and the SHA1 of the resulting commit
is written to 'result_sha1'. The return value from notes_merge() is -1.

The user is told to edit the files within the .git/NOTES_MERGE_WORKTREE
directory in order to resolve the conflicts.

The patch also contains documentation and testcases for the correct setup
of .git/NOTES_MERGE_WORKTREE.

The next part will recombine the partial notes merge result with the
resolved conflicts in .git/NOTES_MERGE_WORKTREE to produce the complete
merge result.

This patch has been improved by the following contributions:
- Jonathan Nieder: Use trace_printf(...) instead of OUTPUT(o, 5, ...)

Thanks-to: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Johan Herland <johan@herland.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Documentation: Preliminary docs on 'git notes merge'Johan Herland Tue, 9 Nov 2010 21:49:50 +0000 (22:49 +0100)

Documentation: Preliminary docs on 'git notes merge'

This patch has been improved by the following contributions:
- Stephen Boyd: Use "automatically resolves" instead of "auto-resolves"
- Stephen Boyd: Remove unbalanced '('

Thanks-to: Stephen Boyd <bebarino@gmail.com>
Signed-off-by: Johan Herland <johan@herland.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

git notes merge: Add automatic conflict resolvers ... Johan Herland Sun, 14 Nov 2010 23:55:12 +0000 (00:55 +0100)

git notes merge: Add automatic conflict resolvers (ours, theirs, union)

The new -s/--strategy command-line option to 'git notes merge' allow the user
to choose how notes merge conflicts should be resolved. There are four valid
strategies to choose from:

1. "manual" (the default): This will let the user manually resolve conflicts.
This option currently fails with an error message. It will be implemented
properly in future patches.

2. "ours": This automatically chooses the local version of a conflict, and
discards the remote version.

3. "theirs": This automatically chooses the remote version of a conflict, and
discards the local version.

4. "union": This automatically resolves the conflict by appending the remote
version to the local version.

The strategies are implemented using the combine_notes_* functions from the
notes.h API.

The patch also includes testcases verifying the correct implementation of
these strategies.

This patch has been improved by the following contributions:
- Jonathan Nieder: Future-proof by always checking add_note() return value
- Stephen Boyd: Use test_commit
- Stephen Boyd: Use correct option name

Thanks-to: Jonathan Nieder <jrnieder@gmail.com>
Thanks-to: Stephen Boyd <bebarino@gmail.com>
Signed-off-by: Johan Herland <johan@herland.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

git notes merge: Handle real, non-conflicting notes... Johan Herland Sun, 14 Nov 2010 23:54:11 +0000 (00:54 +0100)

git notes merge: Handle real, non-conflicting notes merges

This continuation of the 'git notes merge' implementation teaches notes-merge
to properly do real merges between notes trees: Two diffs are performed, one
from $base to $remote, and another from $base to $local. The paths in each
diff are normalized to SHA1 object names. The two diffs are then consolidated
into a single list of change pairs to be evaluated. Each change pair consist
of:

- The annotated object's SHA1
- The $base SHA1 (i.e. the common ancestor notes for this object)
- The $local SHA1 (i.e. the current notes for this object)
- The $remote SHA1 (i.e. the to-be-merged notes for this object)

From the pair ($base -> $local, $base -> $remote), we can determine the merge
result using regular 3-way rules. If conflicts are encountered in this
process, we fail loudly and exit (conflict handling to be added in a future
patch), If we can complete the merge without conflicts, the resulting
notes tree is committed, and the current notes ref updated.

The patch includes added testcases verifying that we can successfully do real
conflict-less merges.

This patch has been improved by the following contributions:
- Jonathan Nieder: Future-proof by always checking add_note() return value
- Stephen Boyd: Use test_commit
- Jonathan Nieder: Use trace_printf(...) instead of OUTPUT(o, 5, ...)
- Junio C Hamano: fixup minor style issues

Thanks-to: Jonathan Nieder <jrnieder@gmail.com>
Thanks-to: Stephen Boyd <bebarino@gmail.com>
Thanks-to: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Johan Herland <johan@herland.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

builtin/notes.c: Refactor creation of notes commits.Johan Herland Tue, 9 Nov 2010 21:49:47 +0000 (22:49 +0100)

builtin/notes.c: Refactor creation of notes commits.

Create new function create_notes_commit() which is slightly more general than
commit_notes() (accepts multiple commit parents and does not auto-update the
notes ref). This function will be used by the notes-merge functionality in
future patches.

Also rewrite builtin/notes.c:commit_notes() to reuse this new function.

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

git notes merge: Initial implementation handling trivia... Johan Herland Tue, 9 Nov 2010 21:49:46 +0000 (22:49 +0100)

git notes merge: Initial implementation handling trivial merges only

This initial implementation of 'git notes merge' only handles the trivial
merge cases (i.e. where the merge is either a no-op, or a fast-forward).

The patch includes testcases for these trivial merge cases.

Future patches will extend the functionality of 'git notes merge'.

This patch has been improved by the following contributions:
- Stephen Boyd: Simplify argc logic
- Stephen Boyd: Use test_commit
- Ævar Arnfjörð Bjarmason: Don't use C99 comments.
- Jonathan Nieder: Add constants for common verbosity values
- Jonathan Nieder: Use trace_printf(...) instead of OUTPUT(o, 5, ...)
- Jonathan Nieder: Remove extraneous show() function
- Jonathan Nieder: Clarify handling of empty/missing notes ref in notes_merge()
- Junio C Hamano: fixup minor style issues

Thanks-to: Stephen Boyd <bebarino@gmail.com>
Thanks-to: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Thanks-to: Jonathan Nieder <jrnieder@gmail.com>
Thanks-to: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Johan Herland <johan@herland.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

builtin/notes.c: Split notes ref DWIMmery into a separa... Johan Herland Tue, 9 Nov 2010 21:49:45 +0000 (22:49 +0100)

builtin/notes.c: Split notes ref DWIMmery into a separate function

expand_notes_ref() is a new function that performs the DWIM transformation
of "foo" -> "refs/notes/foo" where notes refs are expected.

This is done in preparation for future patches which will also need this
DWIM functionality.

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

notes.c: Use two newlines (instead of one) when concate... Johan Herland Tue, 9 Nov 2010 21:49:44 +0000 (22:49 +0100)

notes.c: Use two newlines (instead of one) when concatenating notes

When using combine_notes_concatenate() to concatenate notes, it currently
ensures exactly one newline character between the given notes. However,
when using builtin/notes.c:create_note() to concatenate notes (e.g. by
'git notes append'), it adds a newline character to the trailing newline
of the preceding notes object, thus resulting in _two_ newlines (aka. a
blank line) separating contents of the two notes.

This patch brings combine_notes_concatenate() into consistency with
builtin/notes.c:create_note(), by ensuring exactly _two_ newline characters
between concatenated notes.

The patch also changes a few notes-related selftests accordingly.

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

(trivial) t3303: Indent with tabs instead of spaces... Johan Herland Tue, 9 Nov 2010 21:49:43 +0000 (22:49 +0100)

(trivial) t3303: Indent with tabs instead of spaces for consistency

The rest of the file uses tabs for indenting. Fix the one function
that doesn't.

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

notes.h/c: Propagate combine_notes_fn return value... Johan Herland Sun, 14 Nov 2010 23:52:26 +0000 (00:52 +0100)

notes.h/c: Propagate combine_notes_fn return value to add_note() and beyond

The combine_notes_fn functions uses a non-zero return value to indicate
failure. However, this return value was converted to a call to die()
in note_tree_insert().

Instead, propagate this return value out to add_note(), and return it
from there to enable the caller to handle errors appropriately.

Existing add_note() callers are updated to die() upon failure, thus
preserving the current behaviour. The only exceptions are copy_note()
and notes_cache_put() where we are able to propagate the add_note()
return value instead.

This patch has been improved by the following contributions:
- Jonathan Nieder: Future-proof by always checking add_note() return value
- Jonathan Nieder: Improve clarity of final if-condition in note_tree_insert()

Thanks-to: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Johan Herland <johan@herland.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Merge branch 'mz/maint-rebase-X-fix' into maintJunio C Hamano Wed, 17 Nov 2010 21:18:19 +0000 (13:18 -0800)

Merge branch 'mz/maint-rebase-X-fix' into maint

* mz/maint-rebase-X-fix:
t3402: test "rebase -s<strategy> -X<opt>"

Documentation/git-pull: clarify configurationMartin von Zweigbergk Fri, 12 Nov 2010 18:55:58 +0000 (19:55 +0100)

Documentation/git-pull: clarify configuration

The sentence about 'branch.<name>.rebase' refers to the first sentence
in the paragraph and not to the sentence about avoiding rebasing
non-local changes. Clarify this.

Signed-off-by: Martin von Zweigbergk <martin.von.zweigbergk@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Document that rev-list --graph triggers parent rewriting.Yann Dirson Fri, 12 Nov 2010 08:48:58 +0000 (09:48 +0100)

Document that rev-list --graph triggers parent rewriting.

This may help to understand why --graph causes more comments to
be selected.

Signed-off-by: Yann Dirson <ydirson@altern.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Fix username and password extraction from HTTP URLsGabriel Corona Sun, 14 Nov 2010 01:51:15 +0000 (02:51 +0100)

Fix username and password extraction from HTTP URLs

Change the authentification initialisation to percent-decode username
and password for HTTP URLs.

Signed-off-by: Gabriel Corona <gabriel.corona@enst-bretagne.fr>
Acked-by: Tay Ray Chuan <rctay89@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t5550: test HTTP authentication and userinfo decodingGabriel Corona Sun, 14 Nov 2010 01:51:14 +0000 (02:51 +0100)

t5550: test HTTP authentication and userinfo decoding

Add a test for HTTP authentication and proper percent-decoding of the
userinfo (username and password) part of the URL.

Signed-off-by: Gabriel Corona <gabriel.corona@enst-bretagne.fr>
Acked-by: Tay Ray Chuan <rctay89@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

git instaweb: enable remote_headsGiuseppe Bilotta Thu, 11 Nov 2010 12:26:18 +0000 (13:26 +0100)

git instaweb: enable remote_heads

When using git instaweb to browse a local repository, performance is
much less of an issue, and providing as much information as possible has
a higher priority, so it makes sense to enable remote_heads.

Signed-off-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
Acked-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

gitweb: group remote heads by remoteGiuseppe Bilotta Thu, 11 Nov 2010 12:26:17 +0000 (13:26 +0100)

gitweb: group remote heads by remote

In remote and summary view, display a block for each remote, with the
fetch and push URL(s) as well as the list of the remote heads.

In summary view, if the number of remotes is higher than a prescribed
limit, only display the first <limit> remotes and their fetch and push
urls, without any heads information and without grouping.

Signed-off-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
Acked-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

gitweb: provide a routine to display (sub)sectionsGiuseppe Bilotta Thu, 11 Nov 2010 12:26:16 +0000 (13:26 +0100)

gitweb: provide a routine to display (sub)sections

The routine puts the given contento into a DIV element, automatically
adding a header div. The content can be provided as a standard scalar
value (which is used as-is), as a scalar ref (which is HTML-escaped), as
a function reference to be executed, or as a file handle to be dumped.

Signed-off-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
Acked-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

gitweb: refactor repository URL printingGiuseppe Bilotta Thu, 11 Nov 2010 12:26:15 +0000 (13:26 +0100)

gitweb: refactor repository URL printing

Factor out the code to display the repository URL(s) from summary view
into a format_rep_url() routine.

Signed-off-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
Acked-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

gitweb: remotes view for a single remoteGiuseppe Bilotta Thu, 11 Nov 2010 12:26:14 +0000 (13:26 +0100)

gitweb: remotes view for a single remote

When 'remotes' view is passed the 'hash' parameter, interpret it as the
name of a remote and limit the view the the heads of that remote.

In single-remote view we let the user switch easily to the default
remotes view by specifying an -action_extra for the page header and by
enabling the 'remotes' link in the reference navigation submenu.

Signed-off-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
Acked-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

gitweb: allow action specialization in page headerGiuseppe Bilotta Thu, 11 Nov 2010 12:26:13 +0000 (13:26 +0100)

gitweb: allow action specialization in page header

An optional -action_extra parameter is given to git_header_html() to
identify a variant of the action that is being displayed. For example,
this can be used to specify that the remotes view is being used for a
specific remote and not to display all remotes.

When -action_extra is provided, the action name in the header will be
turned into a link to the action without any arguments or parameters, to
provide a quick link to the non-specific variant of the action.

Signed-off-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
Acked-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

gitweb: nagivation menu for tags, heads and remotesGiuseppe Bilotta Thu, 11 Nov 2010 12:26:12 +0000 (13:26 +0100)

gitweb: nagivation menu for tags, heads and remotes

tags, heads and remotes are all views that inspect a (particular class
of) refs, so allow the user to easily switch between them by adding
the appropriate navigation submenu to each view.

Signed-off-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
Acked-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

gitweb: separate heads and remotes listsGiuseppe Bilotta Thu, 11 Nov 2010 12:26:11 +0000 (13:26 +0100)

gitweb: separate heads and remotes lists

We specialize the 'heads' action to only display local branches, and
introduce a 'remotes' action to display the remote branches (only
available when the remotes_head feature is enabled).

Mirroring this, we also split the heads list in summary view into
local and remote lists, each linking to the appropriate action.

The git_get_heads_list now defaults to 'heads' only, regardless of
whether the remote heads feature is active or not.

Signed-off-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
Acked-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

gitweb: git_get_heads_list accepts an optional list... Giuseppe Bilotta Thu, 11 Nov 2010 12:26:10 +0000 (13:26 +0100)

gitweb: git_get_heads_list accepts an optional list of refs

git_get_heads_list(limit, class1, class2, ...) can now be used to retrieve
refs/class1, refs/class2 etc. Defaults to ('heads', 'remotes') or ('heads')
depending on whether the 'remote_heads' feature is enabled or not.

Signed-off-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
Acked-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

gitweb: introduce remote_heads featureGiuseppe Bilotta Thu, 11 Nov 2010 12:26:09 +0000 (13:26 +0100)

gitweb: introduce remote_heads feature

With this feature enabled, remote heads are retrieved (and displayed)
when getting (and displaying) the heads list. Typical usage would be for
local repository browsing, e.g. by using git-instaweb (or even a more
permanent gitweb setup), to check the repository status and the relation
between tracking branches and the originating remotes.

Signed-off-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
Acked-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

gitweb: use fullname as hash_base in heads linkGiuseppe Bilotta Thu, 11 Nov 2010 12:26:08 +0000 (13:26 +0100)

gitweb: use fullname as hash_base in heads link

Otherwise, if names are manipulated for display, the link will point to
the wrong head.

Signed-off-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
Acked-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

allow command-specific pagers in pager.<cmd>Jeff King Wed, 17 Nov 2010 17:04:12 +0000 (12:04 -0500)

allow command-specific pagers in pager.<cmd>

A user may want different pager settings or even a
different pager for various subcommands (e.g., because they
use different less settings for "log" vs "diff", or because
they have a pager that interprets only log output but not
other commands).

This patch extends the pager.<cmd> syntax to support not
only boolean to-page-or-not-to-page, but also to specify a
pager just for a specific command.

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

log.decorate: accept 0/1 bool valuesJeff King Wed, 17 Nov 2010 17:00:45 +0000 (12:00 -0500)

log.decorate: accept 0/1 bool values

We explicitly document "0" and "1" as synonyms for "false"
and "true" in boolean config options. However, we don't
actually handle those values in git_config_maybe_bool.

In most cases this works fine, as we call git_config_bool,
which in turn calls git_config_bool_or_int, which in turn
calls git_config_maybe_bool. Values of 0/1 are considered
"not bool", but their integer values end up being converted
to the corresponding boolean values.

However, the log.decorate code looks for maybe_bool
explicitly, so that it can fall back to the "short" and
"full" strings. It does not handle 0/1 at all, and considers
them invalid values.

We cannot simply add 0/1 support to git_config_maybe_bool.
That would confuse git_config_bool_or_int, which may want to
distinguish the integer values "0" and "1" from bools.

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

clean: avoid quoting twiceNguyễn Thái Ngọc Duy Mon, 15 Nov 2010 10:12:44 +0000 (17:12 +0700)

clean: avoid quoting twice

qname is the result of quote_path_relative(), which does
quote_c_style_counted() internally. Remove the hard-coded quotes.

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

document sigchain apiJeff King Fri, 12 Nov 2010 04:24:56 +0000 (23:24 -0500)

document sigchain api

It's pretty straightforward, but a stripped-down example
never hurts. And we should make clear that it is explicitly
OK to use SIG_DFL and SIG_IGN.

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

Keep together options controlling the behaviour of... Yann Dirson Wed, 10 Nov 2010 20:27:13 +0000 (21:27 +0100)

Keep together options controlling the behaviour of diffcore-rename.

It makes little sense to have --diff-filter in the middle of them, and
even spares an ifndef::git-format-patch.

Signed-off-by: Yann Dirson <ydirson@altern.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

use persistent memory for rejected pathsClemens Buchacher Mon, 15 Nov 2010 19:52:19 +0000 (20:52 +0100)

use persistent memory for rejected paths

An aborted merge prints the list of rejected paths as part of the
error message. Since commit f66caaf9 (do not overwrite files in
leading path), some of those paths do not have static buffers, so
we have to keep a copy. Use string_list's to accomplish this.

This changes the order of the list to the order in which the paths
are processed. Previously, it was reversed.

Signed-off-by: Clemens Buchacher <drizzd@aon.at>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Merge branch 'maint'Junio C Hamano Mon, 15 Nov 2010 19:00:24 +0000 (11:00 -0800)

Merge branch 'maint'

* maint:
rebase -X: do not clobber strategy

verify-tag: document --verboseRené Scharfe Mon, 8 Nov 2010 18:04:51 +0000 (19:04 +0100)

verify-tag: document --verbose

Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

branch: improve --verbose descriptionRené Scharfe Mon, 8 Nov 2010 18:03:58 +0000 (19:03 +0100)

branch: improve --verbose description

Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

archive: improve --verbose descriptionRené Scharfe Mon, 8 Nov 2010 18:02:57 +0000 (19:02 +0100)

archive: improve --verbose description

Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Describe various forms of "be quiet" using OPT__QUIETJonathan Nieder Mon, 8 Nov 2010 19:54:48 +0000 (13:54 -0600)

Describe various forms of "be quiet" using OPT__QUIET

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

add OPT__FORCERené Scharfe Mon, 8 Nov 2010 18:01:54 +0000 (19:01 +0100)

add OPT__FORCE

Add OPT__FORCE as a helper macro in the same spirit as OPT__VERBOSE
et.al. to simplify defining -f/--force options.

Signed-off-by: Rene Scharfe <rene.scharfe@lstfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

add description parameter to OPT__QUIETRené Scharfe Mon, 8 Nov 2010 18:06:54 +0000 (19:06 +0100)

add description parameter to OPT__QUIET

Allows better help text to be defined than "be quiet". Also make use
of the macro in a place that already had a different description. No
object code changes intended.

Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

add description parameter to OPT__DRY_RUNRené Scharfe Mon, 8 Nov 2010 17:58:51 +0000 (18:58 +0100)

add description parameter to OPT__DRY_RUN

Allows better help text to be defined than "dry run". Also make use
of the macro in places that already had a different description. No
object code changes intended.

Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

add description parameter to OPT__VERBOSERené Scharfe Mon, 8 Nov 2010 17:56:39 +0000 (18:56 +0100)

add description parameter to OPT__VERBOSE

Allows better help text to be defined than "be verbose". Also make use
of the macro in places that already had a different description. No
object code changes intended.

Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

do not overwrite untracked during merge from unborn... Clemens Buchacher Sun, 14 Nov 2010 22:07:49 +0000 (23:07 +0100)

do not overwrite untracked during merge from unborn branch

In case HEAD does not point to a valid commit yet, merge is
implemented as a hard reset. This will cause untracked files to be
overwritten.

Instead, assume the empty tree for HEAD and do a regular merge. An
untracked file will cause the merge to abort and do nothing. If no
conflicting files are present, the merge will have the same effect
as a hard reset.

Signed-off-by: Clemens Buchacher <drizzd@aon.at>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

tests: use test_cmp instead of piping to diff(1)Ævar Arnfjörð Bjarmason Sun, 14 Nov 2010 14:44:16 +0000 (14:44 +0000)

tests: use test_cmp instead of piping to diff(1)

Change submodule tests that piped to diff(1) to use test_cmp. The
resulting unified diff is easier to read.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t7004-tag.sh: re-arrange git tag comment for clarityÆvar Arnfjörð Bjarmason Sun, 14 Nov 2010 14:44:15 +0000 (14:44 +0000)

t7004-tag.sh: re-arrange git tag comment for clarity

Split the "message in editor has initial comment" test into three
tests. The motivation is to be able to only skip the middle part under
NO_GETTEXT_POISON.

In addition the return value of 'git tag' was being returned. We now
check that it's non-zero. I used ! instead of test_must_fail so that
the GIT_EDITOR variable was only used in this command invocation, and
because the surrounding tests use this style.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

setup: make sure git_dir path is in a permanent buffer... Kirill Smelkov Thu, 11 Nov 2010 18:08:23 +0000 (21:08 +0300)

setup: make sure git_dir path is in a permanent buffer, getenv(3) case

getenv(3) returns not-permanent buffer which may be changed by e.g.
putenv(3) call (*).

In practice I've noticed this when trying to do `git commit -m abc`
inside msysgit under wine, getting

$ git commit -m abc
fatal: could not open 'DIR=.git/COMMIT_EDITMSG': No such file or directory
^^^^
(notice introduced 'DIR=' artifact.)

The problem was showing itself only with -m option, and actually, as
debugging showed, originally

git_dir = getenv("GIT_DIR")

returned pointer to

"GIT_DIR=.git\0"
^
git_dir

, we stored it in git_dir, than, after processing -m git-commit option,
we did setenv("GIT_EDITOR", ":") which as (*) says changed environment
variables memory layout - something like this

"...\0GIT_DIR=.git\0"
^
git_dir

and oops - we got wrong git_dir.

Avoid that by strdupping getenv("GIT_DIR") result like we did in 06f354
(setup: make sure git dir path is in a permanent buffer). Unfortunately
this also shows that other getenv usage inside git needs auditing...

(*) from man 3 getenv:

The implementation of getenv() is not required to be reentrant. The
string pointed to by the return value of getenv() may be statically
allocated, and can be modified by a subsequent call to getenv(),
putenv(3), setenv(3), or unsetenv(3).

Cc: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Kirill Smelkov <kirr@mns.spb.ru>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

add: do not rely on dtype being NULL behaviorNguyễn Thái Ngọc Duy Thu, 11 Nov 2010 13:03:22 +0000 (20:03 +0700)

add: do not rely on dtype being NULL behavior

Commit c84de70 (excluded_1(): support exclude files in index -
2009-08-20) added support for excluded() where dtype can be NULL. It
was designed specifically for index matching because there was no
other way to extract dtype information from index. It did not support
wildcard matching (for example, "a*/" pattern would fail to match).

The code was probably misread when commit 108da0d (git add: Add the
"--ignore-missing" option for the dry run - 2010-07-10) was made
because DT_UNKNOWN happens to be zero (NULL) too.

Do not pass DT_UNKNOWN/NULL to excluded(), instead pass a pointer to a
variable that contains DT_UNKNOWN. The real dtype will be extracted
from worktree by excluded(), as expected.

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

git-send-email.perl: make initial In-Reply-To apply... Antonio Ospite Fri, 12 Nov 2010 14:55:08 +0000 (15:55 +0100)

git-send-email.perl: make initial In-Reply-To apply only to first email

When an initial --in-reply-to is supplied, make it apply only to the
first message; --[no-]chain-reply-to setting are honored by second and
subsequent messages; this is also how the git-format-patch option with
the same name behaves.

Moreover, when $initial_reply_to is asked to the user interactively it
is asked as the "Message-ID to be used as In-Reply-To for the _first_
email", this makes the user think that the second and subsequent
patches are not using it but are considered as replies to the first
message or chained according to the --[no-]chain-reply setting.

Look at the v2 series in the illustration to see what the new behavior
ensures:

(before the patch) | (after the patch)
[PATCH 0/2] Here is what I did... | [PATCH 0/2] Here is what I did...
[PATCH 1/2] Clean up and tests | [PATCH 1/2] Clean up and tests
[PATCH 2/2] Implementation | [PATCH 2/2] Implementation
[PATCH v2 0/3] Here is a reroll | [PATCH v2 0/3] Here is a reroll
[PATCH v2 1/3] Clean up | [PATCH v2 1/3] Clean up
[PATCH v2 2/3] New tests | [PATCH v2 2/3] New tests
[PATCH v2 3/3] Implementation | [PATCH v2 3/3] Implementation

This is the typical behaviour we want when we send a series with cover
letter in reply to some discussion, the new patch series should appear
as a separate subtree in the discussion.

Also update the documentation on --in-reply-to to describe the new
behavior.

Signed-off-by: Antonio Ospite <ospite@studenti.unina.it>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t3402: test "rebase -s<strategy> -X<opt>"Junio C Hamano Thu, 11 Nov 2010 21:28:57 +0000 (13:28 -0800)

t3402: test "rebase -s<strategy> -X<opt>"

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

Documentation: point to related commands from gitignoreJonathan Nieder Wed, 10 Nov 2010 19:00:48 +0000 (13:00 -0600)

Documentation: point to related commands from gitignore

A frequently asked question on #git is how to stop tracking a file
that is mistakenly tracked by git. A frequently attempted strategy is
to add such files to .gitignore.

Thus one might imagine that the gitignore documentation could be a
good entry point for 'git rm' documentation. Add some
cross-references in this vein.

While at it, move a reference to update-index --assume-unchanged from
the DESCRIPTION to lower down on the page. This way, the methodical
reader can benefit from first learning what excludes files do, then
how they relate to other git facilities.

Based-on-patch-by: Sitaram Chamarty <sitaram@atc.tcs.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Documentation: split gitignore page into sectionsJonathan Nieder Wed, 10 Nov 2010 18:57:39 +0000 (12:57 -0600)

Documentation: split gitignore page into sections

A learner-by-example might want to look at the examples section first.
Help her out by supplying some section headings: PATTERN FORMAT for
the format of lines in an excludes file and EXAMPLES for the two
examples.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

gitweb: Time::HiRes is in core for Perl 5.8Jakub Narebski Tue, 9 Nov 2010 18:27:54 +0000 (19:27 +0100)

gitweb: Time::HiRes is in core for Perl 5.8

We say 'use 5.008' at the beginning of the script, therefore there is no
need to check if Time::HiRes module is available. We can also import
gettimeofday and tv_interval.

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Remove pack file handling dependency from wrapper.oJonathan Nieder Sat, 6 Nov 2010 19:00:38 +0000 (14:00 -0500)

Remove pack file handling dependency from wrapper.o

As v1.7.0-rc0~43 (slim down "git show-index", 2010-01-21) explains,
use of xmalloc() brings in a dependency on zlib, the sha1 lib, and the
rest of git's object file access machinery via try_to_free_pack_memory.
That is overkill when xmalloc is just being used as a convenience
wrapper to exit when no memory is available.

So defer setting try_to_free_pack_memory as try_to_free_routine until
the first packfile is opened in add_packed_git().

After this change, a simple program using xmalloc() and no other
functions will not pull in any code from libgit.a aside from wrapper.o
and usage.o.

Improved-by: René Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

pack-objects: mark file-local variable staticJonathan Nieder Sat, 6 Nov 2010 11:47:57 +0000 (06:47 -0500)

pack-objects: mark file-local variable static

old_try_to_free_routine is not meant for use from other files.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

wrapper: give zlib wrappers their own translation unitJonathan Nieder Sat, 6 Nov 2010 11:47:34 +0000 (06:47 -0500)

wrapper: give zlib wrappers their own translation unit

Programs using xmalloc() but not git_inflate() require -lz on the
linker command line because git_inflate() is in the same translation
unit as xmalloc().

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

strbuf: move strbuf_branchname to sha1_name.cJonathan Nieder Sat, 6 Nov 2010 11:46:52 +0000 (06:46 -0500)

strbuf: move strbuf_branchname to sha1_name.c

strbuf_branchname is a thin wrapper around interpret_branch_name
from sha1_name.o. Most strbuf.o users do not need it.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

path helpers: move git_mkstemp* to wrapper.cJonathan Nieder Sat, 6 Nov 2010 11:46:31 +0000 (06:46 -0500)

path helpers: move git_mkstemp* to wrapper.c

git_mkstemp_mode and related functions do not require access to
specialized git machinery, unlike some other functions from
path.c (like set_shared_perm()). Move them to wrapper.c where
the wrapper xmkstemp_mode is defined.

This eliminates a dependency of wrapper.o on environment.o via
path.o. With typical linkers (e.g., gcc), that dependency makes
programs that use functions from wrapper.o and not environment.o
or path.o larger than they need to be.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

wrapper: move odb_* to environment.cJonathan Nieder Sat, 6 Nov 2010 11:45:38 +0000 (06:45 -0500)

wrapper: move odb_* to environment.c

The odb_mkstemp and odb_pack_keep functions open files under the
$GIT_OBJECT_DIRECTORY directory. This requires access to the git
configuration which very simple programs do not need.

Move these functions to environment.o, closer to their dependencies.
This should make it easier for programs to link to wrapper.o without
linking to environment.o.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

wrapper: move xmmap() to sha1_file.cJonathan Nieder Sat, 6 Nov 2010 11:44:11 +0000 (06:44 -0500)

wrapper: move xmmap() to sha1_file.c

wrapper.o depends on sha1_file.o for a number of reasons. One is
release_pack_memory().

xmmap function calls mmap, discarding unused pack windows when
necessary to relieve memory pressure. Simple git programs using
wrapper.o as a friendly libc do not need this functionality.
So move xmmap to sha1_file.o, where release_pack_memory() is.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

notes.h/c: Allow combine_notes functions to remove... Johan Herland Tue, 9 Nov 2010 21:49:41 +0000 (22:49 +0100)

notes.h/c: Allow combine_notes functions to remove notes

Allow combine_notes functions to request that a note be removed, by setting
the resulting note SHA1 to null_sha1 (0000000...).

For consistency, also teach note_tree_insert() to skip insertion of an empty
note (a note with entry->val_sha1 equal to null_sha1) when there is no note
to combine it with.

In general, an empty note (null_sha1) is treated identically to no note at
all, but when adding an empty note where there already exists a non-empty
note, we allow the combine_notes function to potentially record a new/changed
note. Document this behaviour, and clearly specify how combine_notes functions
are expected to handle null_sha1 in input.

Before this patch, storing null_sha1s in the notes tree were silently allowed,
causing an invalid notes tree (referring to blobs with null_sha1) to be
produced by write_notes_tree().

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

notes.c: Reorder functions in preparation for next... Johan Herland Tue, 9 Nov 2010 21:49:40 +0000 (22:49 +0100)

notes.c: Reorder functions in preparation for next commit

This patch introduces no functional change. It consists solely of reordering
functions in notes.c to avoid use-before-declaration errors after applying
the next commit in this series.

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

notes.h: Make default_notes_ref() available in notes APIJohan Herland Tue, 9 Nov 2010 21:49:39 +0000 (22:49 +0100)

notes.h: Make default_notes_ref() available in notes API

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

(trivial) notes.h: Minor documentation fixes to copy_no... Johan Herland Tue, 9 Nov 2010 21:49:38 +0000 (22:49 +0100)

(trivial) notes.h: Minor documentation fixes to copy_notes()

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

notes.c: Hexify SHA1 in die() message from init_notes()Johan Herland Tue, 9 Nov 2010 21:49:37 +0000 (22:49 +0100)

notes.c: Hexify SHA1 in die() message from init_notes()

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

tag: recognize rfc1991 signaturesMichael J Gruber Wed, 10 Nov 2010 11:17:30 +0000 (12:17 +0100)

tag: recognize rfc1991 signatures

We have always been creating rfc1991 signatures for users with "rfc1991"
in their gpg config but failed to recognize them (tag -l -n largenumber)
and verify them (tag -v, verify-tag).

Make good use of the refactored signature detection and let us recognize
and verify those signatures also.

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

tag: factor out sig detection for tag displayMichael J Gruber Wed, 10 Nov 2010 11:17:29 +0000 (12:17 +0100)

tag: factor out sig detection for tag display

Use the factored out code for sig detection when displaying tags.

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

tag: factor out sig detection for body editsMichael J Gruber Wed, 10 Nov 2010 11:17:28 +0000 (12:17 +0100)

tag: factor out sig detection for body edits

Use the factored out code for sig detection when editing existing
tag bodies (tag -a -f without -m).

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

verify-tag: factor out signature detectionMichael J Gruber Wed, 10 Nov 2010 11:17:27 +0000 (12:17 +0100)

verify-tag: factor out signature detection

into tag.h/c for later reuse and modification.

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>