Commit graph

392 commits

Author SHA1 Message Date
Thiago Farina 47e44ed1dc commit: Add commit_list prefix in two function names.
Add commit_list prefix to insert_by_date function and to sort_by_date,
so it's clear that these functions refer to commit_list structure.

Signed-off-by: Thiago Farina <tfransosi@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-11-29 14:01:52 -08:00
Junio C Hamano 7d43de925b Merge branch 'cb/maint-orphan-merge-noclobber'
* cb/maint-orphan-merge-noclobber:
  do not overwrite untracked during merge from unborn branch
2010-11-24 15:55:36 -08:00
Junio C Hamano 20f84c8f56 Merge branch 'rs/opt-help-text'
* rs/opt-help-text:
  verify-tag: document --verbose
  branch: improve --verbose description
  archive: improve --verbose description
  Describe various forms of "be quiet" using OPT__QUIET
  add OPT__FORCE
  add description parameter to OPT__QUIET
  add description parameter to OPT__DRY_RUN
  add description parameter to OPT__VERBOSE
2010-11-24 15:55:19 -08:00
Junio C Hamano 786f174dab Merge branch 'mm/phrase-remote-tracking'
* mm/phrase-remote-tracking:
  git-branch.txt: mention --set-upstream as a way to change upstream configuration
  user-manual: remote-tracking can be checked out, with detached HEAD
  user-manual.txt: explain better the remote(-tracking) branch terms
  Change incorrect "remote branch" to "remote tracking branch" in C code
  Change incorrect uses of "remote branch" meaning "remote-tracking"
  Change "tracking branch" to "remote-tracking branch"
  everyday.txt: change "tracking branch" to "remote-tracking branch"
  Change remote tracking to remote-tracking in non-trivial places
  Replace "remote tracking" with "remote-tracking"
  Better "Changed but not updated" message in git-status
2010-11-24 15:55:05 -08:00
Junio C Hamano ee438efbc1 Merge branch 'jk/maint-apply-no-binary'
* jk/maint-apply-no-binary:
  apply: don't segfault on binary files with missing data
2010-11-17 15:01:18 -08:00
Junio C Hamano 0510480510 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
2010-11-17 15:01:00 -08:00
Junio C Hamano ba0254cb32 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
2010-11-17 15:00:56 -08:00
Junio C Hamano e2110c8d88 Merge branch 'jn/send-pack-error'
* jn/send-pack-error:
  send-pack: avoid redundant "pack-objects died with strange error"
2010-11-17 15:00:51 -08:00
Junio C Hamano 07e0a8314d Merge branch 'jk/maint-rev-list-nul'
* jk/maint-rev-list-nul:
  rev-list: handle %x00 NUL in user format
2010-11-17 14:59:33 -08:00
Junio C Hamano dd9d290bc9 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
2010-11-17 14:59:27 -08:00
Junio C Hamano 5a7a0fae8f 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>"
2010-11-17 13:57:58 -08:00
Nguyễn Thái Ngọc Duy 1c7d402b3e 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>
2010-11-17 13:26:38 -08:00
Nguyễn Thái Ngọc Duy 71567e3287 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>
2010-11-16 10:22:37 -08:00
René Scharfe 6e565345e8 verify-tag: document --verbose
Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-11-15 10:05:54 -08:00
René Scharfe 3927142561 branch: improve --verbose description
Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-11-15 10:05:44 -08:00
Jonathan Nieder 8c83968385 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>
2010-11-15 10:04:56 -08:00
René Scharfe 76946b76fe 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>
2010-11-15 10:04:43 -08:00
René Scharfe d52ee6e613 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>
2010-11-15 09:58:13 -08:00
René Scharfe e21adb8c10 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>
2010-11-15 09:57:37 -08:00
René Scharfe fd03881a48 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>
2010-11-15 09:56:51 -08:00
Clemens Buchacher 172b6428d0 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>
2010-11-15 09:27:33 -08:00
Matthieu Moy 13931236b9 Change incorrect "remote branch" to "remote tracking branch" in C code
(Just like we did for documentation already)

In the process, we change "non-remote branch" to "branch outside the
refs/remotes/ hierarchy" to avoid the ugly "non-remote-tracking branch".
The new formulation actually corresponds to how the code detects this
case (i.e. prefixcmp(refname, "refs/remotes")).

Also, we use 'remote-tracking branch' in generated merge messages (by
merge an fmt-merge-msg).

Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-11-03 09:20:47 -07:00
Matthieu Moy 8b3f3f84b2 Change "tracking branch" to "remote-tracking branch"
One more step towards consistancy. We change the documentation and the C
code in a single patch, since the only instances in the C code are in
comment and usage strings.

Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-11-03 09:20:41 -07:00
Matthieu Moy 0e615b252f Replace "remote tracking" with "remote-tracking"
"remote-tracking" branch makes it explicit that the branch is "tracking a
remote", as opposed to "remote, and tracking something".

See discussion in e.g.
http://mid.gmane.org/8835ADF9-45E5-4A26-9F7F-A72ECC065BB2@gmail.com
for more details.

This patch is a straightforward application of

  perl -pi -e 's/remote tracking branch/remote-tracking branch/'

except in the RelNotes directory.

Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-11-03 09:19:04 -07:00
Jeff King 24305cd700 apply: don't segfault on binary files with missing data
Usually when applying a binary diff generated without
--binary, it will be rejected early, as we don't even have
the full sha1 of the pre- and post-images.

However, if the diff is generated with --full-index (but not
--binary), then we will actually try to apply it. If we have
the postimage blob, then we can take a shortcut and never
even look at the binary diff at all (e.g., this can happen
when rebasing changes within a repository).

If we don't have the postimage blob, though, we try to look
at the actual fragments, of which there are none, and get a
segfault. This patch checks explicitly for that case and
complains to the user instead of segfaulting. We need to
keep the check at a low level so that the "shortcut" case
above continues to work.

We also add a test that demonstrates the segfault. While
we're at it, let's also explicitly test the shortcut case.

Reported-by: Rafaël Carré <rafael.carre@gmail.com>
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-10-29 14:13:33 -07:00
Junio C Hamano 75b17fee72 Merge branch 'jf/merge-ignore-ws'
* jf/merge-ignore-ws:
  merge-recursive: options to ignore whitespace changes
  merge-recursive --patience
  ll-merge: replace flag argument with options struct
  merge-recursive: expose merge options for builtin merge
2010-10-26 21:40:54 -07:00
Junio C Hamano d4c4369752 Sync with 1.7.3.2
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-10-21 17:16:10 -07:00
Jeff King d7c411b71d push: pass --progress down to git-pack-objects
When pushing via builtin transports (like file://, git://), the
underlying transport helper (in this case, git-pack-objects) did not get
the --progress option, even if it was passed to git push.

Fix this, and update the tests to reflect this.

Note that according to the git-pack-objects documentation, we can safely
apply the usual --progress semantics for the transport commands like
clone and fetch (and for pushing over other smart transports).

Reported-by: Chase Brammer <cbrammer@gmail.com>
Helped-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Tay Ray Chuan <rctay89@gmail.com>
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-10-18 16:20:19 -07:00
Jonathan Nieder 64f003abd9 send-pack: avoid redundant "pack-objects died with strange error"
Saying "pack-objects died with strange error" after "pack-objects died
of signal 13" seems kind of redundant.  The latter message was
introduced when the run-command API changed to report abnormal exits
on behalf of the caller (v1.6.5-rc0~86^2~5, 2009-07-04).

Similarly, after a controlled pack-objects failure (detectable as a
normal exit with nonzero status), a "died with strange error" message
would be redundant next to the message from pack-objects itself.

So leave off the "strange error" messages.

The result should look something like this:

	$ git push sf master
	Counting objects: 21542, done.
	Compressing objects: 100% (4179/4179), done.
	fatal: Unable to create temporary file: Permission denied
	error: pack-objects died of signal 13
	error: failed to push some refs to 'ssh://sf.net/gitroot/project/project'
	$

Or in the "controlled exit" case (contrived example):

	[...]
	fatal: delta size changed
	error: failed to push some refs to 'ssh://example.com/foo/bar'
	$

Improved-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-10-18 16:12:09 -07:00
Thomas Rast 55846b9abd merge-file: correctly find files when called in subdir
Since b541248 (merge.conflictstyle: choose between "merge" and "diff3
-m" styles, 2008-08-29), git-merge-file uses setup_directory_gently(),
thus cd'ing around to find any possible config files to use.

This broke merge-file when it is called from within a subdirectory of
a repository, and the arguments are all relative paths.

Fix by prepending the prefix, as passed down from the main git
setup code, if there is any.

Signed-off-by: Thomas Rast <trast@student.ethz.ch>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-10-18 16:10:57 -07:00
Jeff King 9130ac9fe1 rev-list: handle %x00 NUL in user format
The code paths for showing commits in "git log" and "git
rev-list --graph" correctly handle embedded NULs by looking
only at the resulting strbuf's length, and never treating it
as a C string. The code path for regular rev-list, however,
used printf("%s"), which resulted in truncated output. This
patch uses fwrite instead, like the --graph code path.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-10-13 18:58:33 -07:00
Štěpán Němec d0bb136630 Fix {update,checkout}-index usage strings
The `<file>' argument is optional in both cases (the man pages are
already correct).

Signed-off-by: Štěpán Němec <stepnem@gmail.com>
Acked-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-10-08 12:31:08 -07:00
Štěpán Němec 884220653f Put a space between `<' and argument in pack-objects usage string
This makes it cosistent with other places (including the
git-pack-objects(1) manpage itself) and avoids possible confusion (I,
for one, mistook `<object-list' for a `<object-list>' typo at first when
preparing this series).

Signed-off-by: Štěpán Němec <stepnem@gmail.com>
Acked-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-10-08 12:31:08 -07:00
Štěpán Němec 0adda9362a Use parentheses and `...' where appropriate
Remove some stray usage of other bracket types and asterisks for the
same purpose.

Signed-off-by: Štěpán Němec <stepnem@gmail.com>
Acked-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-10-08 12:31:07 -07:00
Štěpán Němec 62b4698e55 Use angles for placeholders consistently
Signed-off-by: Štěpán Němec <stepnem@gmail.com>
Acked-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-10-08 12:29:52 -07:00
Jonathan Nieder 79bc2af5ae commit-tree: free commit message before exiting
This buffer is freed by the C runtime when commit-tree exits moments
later, but freeing it explicitly should make valgrind quieter.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-10-06 20:30:17 -07:00
Junio C Hamano 4ac9aeb2b2 Merge branch 'bc/fix-cherry-pick-root'
* bc/fix-cherry-pick-root:
  builtin/revert.c: don't dereference a NULL pointer
2010-10-06 12:11:20 -07:00
Junio C Hamano 90215bf300 Merge branch 'maint'
* maint:
  Documentation/git-clone: describe --mirror more verbosely
  do not depend on signed integer overflow
  work around buggy S_ISxxx(m) implementations
  xdiff: cast arguments for ctype functions to unsigned char
  init: plug tiny one-time memory leak
  diffcore-pickaxe.c: remove unnecessary curly braces
  t3020 (ls-files-error-unmatch): remove stray '1' from end of file
  setup: make sure git dir path is in a permanent buffer
  environment.c: remove unused variable
  git-svn: fix processing of decorated commit hashes
  git-svn: check_cherry_pick should exclude commits already in our history
  Documentation/git-svn: discourage "noMetadata"
2010-10-06 12:10:02 -07:00
Erik Faye-Lund c03c83152d do not depend on signed integer overflow
Signed integer overflow is not defined in C, so do not depend on it.

This fixes a problem with GCC 4.4.0 and -O3 where the optimizer would
consider "consumed_bytes > consumed_bytes + bytes" as a constant
expression, and never execute the die()-call.

Signed-off-by: Erik Faye-Lund <kusmabite@gmail.com>
Acked-by: Nicolas Pitre <nico@fluxnic.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-10-06 11:10:07 -07:00
Jonathan Nieder 9173912be3 init: plug tiny one-time memory leak
The buffer used to construct paths like ".git/objects/info" and
".git/objects/pack" is allocated on the heap and never freed.

So free it.  While at it, factor out the relevant code into its own
function and rename the sha1_dir variable to object_directory (to
match the change in everyday usage after the renaming of
SHA1_FILE_DIRECTORY in v0.99~603^2~7, 2005).

Noticed by valgrind while setting up tests (in test-lib).

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-10-06 10:46:05 -07:00
Junio C Hamano 1e63341847 Merge branch 'maint'
* maint:
  Fix typo in pack-objects' usage
  Make sure that git_getpass() never returns NULL
  t0004 (unwritable files): simplify error handling
  rev-list-options: clarify --parents and --children
2010-09-30 14:59:53 -07:00
Johannes Schindelin 8695353147 Fix typo in pack-objects' usage
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-09-30 12:22:02 -07:00
Kirill Smelkov 900647104e blame,cat-file --textconv: Don't assume mode is ``S_IFREF | 0664''
We need to get the correct mode when blame reads the source from the
working tree, the index, or trees.  This allows us to omit running
textconv filters on symbolic links.

Signed-off-by: Kirill Smelkov <kirr@landau.phys.spbu.ru>
Reviewed-by: Matthieu Moy <Matthieu.Moy@grenoble-inp.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-09-29 16:53:25 -07:00
Junio C Hamano 2a1be3f8c4 Merge branch 'jk/read-tree-empty'
* jk/read-tree-empty:
  read-tree: deprecate syntax without tree-ish args
2010-09-29 13:49:18 -07:00
Junio C Hamano 7fd739cd57 Merge branch 'rr/format-patch-count-without-merges'
* rr/format-patch-count-without-merges:
  format-patch: Don't go over merge commits
  t4014-format-patch: Call test_tick before committing
2010-09-29 13:49:09 -07:00
Junio C Hamano 02ef0ed710 Merge branch 'rr/fmt-merge-msg'
* rr/fmt-merge-msg:
  t6200-fmt-merge-msg: Exercise '--log' to configure shortlog length
  t6200-fmt-merge-msg: Exercise 'merge.log' to configure shortlog length
  merge: Make 'merge.log' an integer or boolean option
  merge: Make '--log' an integer option for number of shortlog entries
  fmt_merge_msg: Change fmt_merge_msg API to accept shortlog_len

Conflicts:
	builtin/merge.c
2010-09-29 13:48:20 -07:00
Daniel Knittl-Frank 3695dc0af1 Improvements to git checkout -h
be a little more verbose about what each option does

Signed-off-by: Daniel Knittl-Frank <knittl89+git@googlemail.com>
Reviewed-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-09-27 10:54:17 -07:00
Brandon Casey 6355e505ba builtin/revert.c: don't dereference a NULL pointer
cherry-pick will segfault when transplanting a root commit if the --ff
option is used.  This happens because the "parent" pointer is set to NULL
when the commit being cherry-picked has no parents.  Later, when "parent"
is dereferenced, the cherry-pick segfaults.

Fix this by checking whether "parent" is NULL before dereferencing it and
add a test for this case of cherry-picking a root commit with --ff.

Reported-by: Zbyszek Szmek <zbyszek@in.waw.pl>
Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-09-27 10:39:54 -07:00
Junio C Hamano 2e1e96126f Merge branch 'dr/maint-ls-tree-prefix-recursion-fix'
* dr/maint-ls-tree-prefix-recursion-fix:
  ls-tree $di $dir: do not mistakenly recurse into directories
2010-09-15 12:41:13 -07:00
Junio C Hamano b294ed637d ls-tree $di $dir: do not mistakenly recurse into directories
When applying two pathspecs, one of which is named as a prefix to the
other, we mistakenly recursed into the shorter one.

Noticed and fixed by David Reis.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-09-12 13:52:03 -07:00