1
0
mirror of https://github.com/git/git.git synced 2024-10-03 16:22:22 +02:00
Commit Graph

12344 Commits

Author SHA1 Message Date
Shawn Bohrer
113f10f22f Make git-clean a builtin
This replaces git-clean.sh with builtin-clean.c, and moves
git-clean.sh to the examples.

This also introduces a change in behavior when removing directories
explicitly specified as a path.  For example currently:

1. When dir has only untracked files, these two behave differently:

    $ git clean -n dir
    $ git clean -n dir/

the former says "Would not remove dir/", while the latter would say
"Would remove dir/untracked" for all paths under it, but not the
directory itself.

With -d, the former would stop refusing, however since the user
explicitly asked to remove the directory the -d is no longer required.

2. When there are more parameters:

    $ git clean -n dir foo
    $ git clean -n dir/ foo

both cases refuse to remove dir/ unless -d is specified.  Once again
since both cases requested to remove dir the -d is no longer required.

Thanks to Johannes Schindelin for the conversion to using the
parse-options API.

Signed-off-by: Shawn Bohrer <shawn.bohrer@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-11-18 19:11:42 -08:00
Junio C Hamano
ea55960518 Update draft release notes for 1.5.4
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-11-18 16:24:14 -08:00
Junio C Hamano
5d3d1cacc1 Merge branch 'lt/rev-list-gitlink'
* lt/rev-list-gitlink:
  Fix rev-list when showing objects involving submodules
2007-11-18 16:16:37 -08:00
Junio C Hamano
d577bc58a3 Merge branch 'ds/checkout-upper'
* ds/checkout-upper:
  git-checkout: Test for relative path use.
  git-checkout: Support relative paths containing "..".
2007-11-18 16:04:17 -08:00
Junio C Hamano
ffa06873d6 Merge branch 'sh/p4'
* sh/p4:
  git-p4: Fix direct import from perforce after fetching changes through git from origin
2007-11-18 16:03:58 -08:00
Junio C Hamano
761e8566cb Merge branch 'lt/rev-list-interactive'
* lt/rev-list-interactive:
  Fix parent rewriting in --early-output
  revision walker: mini clean-up
  Enhance --early-output format
  Add "--early-output" log flag for interactive GUI use
  Simplify topo-sort logic
2007-11-18 16:03:24 -08:00
Junio C Hamano
e6cb314c08 Merge branch 'ph/diffopts'
* ph/diffopts:
  Reorder diff_opt_parse options more logically per topics.
  Make the diff_options bitfields be an unsigned with explicit masks.
  Use OPT_BIT in builtin-pack-refs
  Use OPT_BIT in builtin-for-each-ref
  Use OPT_SET_INT and OPT_BIT in builtin-branch
  parse-options new features.
2007-11-18 15:50:16 -08:00
Junio C Hamano
41d8a5f0f7 Draft release notes: fix clean.requireForce description
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-11-18 15:22:51 -08:00
Junio C Hamano
4a44b9ea51 Merge branch 'maint' to synchronize with 1.5.3.6
* maint:
  GIT 1.5.3.6
  grep -An -Bm: fix invocation of external grep command

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-11-18 15:21:12 -08:00
Junio C Hamano
005e2dfdf2 GIT 1.5.3.6 v1.5.3.6 2007-11-18 14:00:38 -08:00
Guido Ostkamp
4e0da76318 Use compat mkdtemp() on Solaris boxes
Define NO_MKDTEMP for all variants of SunOS; Solaris 10 does not
have mkdtemp() and all the other versions our Makefile knows
about don't have it either.

NO_{SETENV,UNSETENV,C99_FORMAT,STRTOUMAX} definitions cannot be
unified across versions.  Beginning with Solaris 10, the C-library
provides unsetenv(), setenv() and strtoumax().  Also 'z'/'t' formats
are supported.  However, older versions of Solaris do not support
these.


Signed-off-by: Guido Ostkamp <git@ostkamp.fastmail.fm>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-11-18 09:45:20 -08:00
Junio C Hamano
9f4c4eb0e1 Merge branch 'ph/parseopt-sh'
* ph/parseopt-sh:
  git-quiltimport.sh fix --patches handling
  git-am: -i does not take a string parameter.
  sh-setup: don't let eval output to be shell-expanded.
  git-sh-setup: fix parseopt `eval` string underquoting
  Give git-am back the ability to add Signed-off-by lines.
  git-rev-parse --parseopt
  scripts: Add placeholders for OPTIONS_SPEC
  Migrate git-repack.sh to use git-rev-parse --parseopt
  Migrate git-quiltimport.sh to use git-rev-parse --parseopt
  Migrate git-checkout.sh to use git-rev-parse --parseopt --keep-dashdash
  Migrate git-instaweb.sh to use git-rev-parse --parseopt
  Migrate git-merge.sh to use git-rev-parse --parseopt
  Migrate git-am.sh to use git-rev-parse --parseopt
  Migrate git-clone to use git-rev-parse --parseopt
  Migrate git-clean.sh to use git-rev-parse --parseopt.
  Update git-sh-setup(1) to allow transparent use of git-rev-parse --parseopt
  Add a parseopt mode to git-rev-parse to bring parse-options to shell scripts.
2007-11-17 21:39:37 -08:00
Junio C Hamano
4b87474bc9 grep -An -Bm: fix invocation of external grep command
When building command line to invoke external grep, the
arguments to -A/-B/-C options were placd in randarg[] buffer,
but the code forgot that snprintf() does not count terminating
NUL in its return value.  This caused "git grep -A1 -B2" to
invoke external grep with "-B21 -A1".

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-11-17 21:19:55 -08:00
Junio C Hamano
9716f21b48 Merge git://git.bogomips.org/git-svn
* git://git.bogomips.org/git-svn:
  git-svn: Fix a typo and add a comma in an error message in git-svn
  git-svn log: handle unreachable revisions like "svn log"
  git-svn log: include commit log for the smallest revision in a range
  git-svn log: fix ascending revision ranges
  git-svn's dcommit must use subversion's config
  git-svn: add tests for command-line usage of init and clone commands
2007-11-17 16:40:03 -08:00
David Reiss
826a93398d git-svn: Fix a typo and add a comma in an error message in git-svn
Signed-off-by: David Reiss <dreiss@facebook.com>
Acked-by: Eric Wong <normalperson@yhbt.net>
2007-11-17 13:39:47 -08:00
David D Kilzer
111947ef8c git-svn log: handle unreachable revisions like "svn log"
When unreachable revisions are given to "svn log", it displays all commit
logs in the given range that exist in the current tree.  (If no commit
logs are found in the current tree, it simply prints a single commit log
separator.)  This patch makes "git-svn log" behave the same way.

Ten tests added to t/t9116-git-svn-log.sh.

Signed-off-by: David D Kilzer <ddkilzer@kilzer.net>
Acked-by: Eric Wong <normalperson@yhbt.net>
2007-11-17 13:28:21 -08:00
David D Kilzer
60f3ff1257 git-svn log: include commit log for the smallest revision in a range
The "svn log -rM:N" command shows commit logs inclusive in the range [M,N].
Previously "git-svn log" always excluded the commit log for the smallest
revision in a range, whether the range was ascending or descending.  With
this patch, the smallest revision in a range is always shown.

Updated tests for ascending and descending revision ranges.

Signed-off-by: David D Kilzer <ddkilzer@kilzer.net>
Acked-by: Eric Wong <normalperson@yhbt.net>
2007-11-17 13:28:21 -08:00
David D Kilzer
fede44b2e1 git-svn log: fix ascending revision ranges
Fixed typo in Git::SVN::Log::git_svn_log_cmd().  Previously a command like
"git-svn log -r1:4" would only show a commit log separator.

Added tests for ascending and descending revision ranges.

Signed-off-by: David D Kilzer <ddkilzer@kilzer.net>
Acked-by: Eric Wong <normalperson@yhbt.net>
2007-11-17 13:28:21 -08:00
Konstantin V. Arkhipov
3caf320ba8 git-svn's dcommit must use subversion's config
When doing dcommit git-svn must use subversion's config or newly created
files will not include svn's properties
(defined in [auto-props] with 'enable-auto-props = yes').

Signed-off-by: Konstantin V. Arkhipov <voxus@onphp.org>
Acked-by: Eric Wong <normalperson@yhbt.net>
2007-11-17 13:28:21 -08:00
Eric Wong
41337e22f0 git-svn: add tests for command-line usage of init and clone commands
Some patches broke these commands in certain cases and were only
caught by manual testing.

Signed-off-by: Eric Wong <normalperson@yhbt.net>
2007-11-17 13:28:21 -08:00
Junio C Hamano
dee1b1ea9e Update draft release notes for 1.5.4
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-11-17 00:57:57 -08:00
Mike Hommey
eb9d2b91cf Fix and improve t7004 (git-tag tests)
Brown paper bag fix to avoid using non portable sed syntax. The
test by itself didn't catch what it was supposed to, anyways.

The new test first checks if git-tag correctly errors out when
the user exited the editor without editing the file.  Then it
checks if what the user was presented in the editor was any
useful, which we define as the following:

 * It begins with a single blank line, where the invoked editor
   would typically place the editing curser at, so that the user
   can immediately start typing;

 * It has some instruction but that comes after that initial
   blank line, all lines prefixed with "#".  We specifically do
   not check for the wording of this instruction.

 * And it has nothing else, as the expected behaviour is "Hey
   you did not leave any message".

Signed-off-by: Mike Hommey <mh@glandium.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-11-17 00:57:05 -08:00
Sergei Organov
347989f4ea Documentation: fix git-clone manpage not to refer to itself
Signed-off-by: Sergei Organov <osv@javad.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-11-17 00:57:05 -08:00
Sergei Organov
e502c2c31f user-manual.txt: minor clarification.
Signed-off-by: Sergei Organov <osv@javad.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-11-17 00:57:05 -08:00
Junio C Hamano
f1a82fe9a3 Merge branch 'maint'
* maint:
  Update draft release notes for 1.5.3.6
  Fix per-directory exclude handing for "git add"
  core.excludesfile clean-up
  Fix t9101 test failure caused by Subversion "auto-props"
  git-send-email: add charset header if we add encoded 'From'
2007-11-16 21:30:06 -08:00
Junio C Hamano
78e694787c Update draft release notes for 1.5.3.6
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-11-16 21:17:01 -08:00
Junio C Hamano
b574c8d846 Merge branch 'ds/maint-deflatebound' into maint
* ds/maint-deflatebound:
  Improve accuracy of check for presence of deflateBound.
2007-11-16 21:14:17 -08:00
Junio C Hamano
0e06cc8b82 Fix per-directory exclude handing for "git add"
In "dir_struct", each exclusion element in the exclusion stack records a
base string (pointer to the beginning with length) so that we can tell
where it came from, but this pointer is just pointing at the parameter
that is given by the caller to the push_exclude_per_directory()
function.

While read_directory_recursive() runs, calls to excluded() makes use
the data in the exclusion elements, including this base string.  The
caller of read_directory_recursive() is not supposed to free the
buffer it gave to push_exclude_per_directory() earlier, until it
returns.

The test case Bruce Stephens gave in the mailing list discussion
was simplified and added to the t3700 test.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-11-16 17:05:13 -08:00
Junio C Hamano
dcf0c16ef1 core.excludesfile clean-up
There are inconsistencies in the way commands currently handle
the core.excludesfile configuration variable.  The problem is
the variable is too new to be noticed by anything other than
git-add and git-status.

 * git-ls-files does not notice any of the "ignore" files by
   default, as it predates the standardized set of ignore files.
   The calling scripts established the convention to use
   .git/info/exclude, .gitignore, and later core.excludesfile.

 * git-add and git-status know about it because they call
   add_excludes_from_file() directly with their own notion of
   which standard set of ignore files to use.  This is just a
   stupid duplication of code that need to be updated every time
   the definition of the standard set of ignore files is
   changed.

 * git-read-tree takes --exclude-per-directory=<gitignore>,
   not because the flexibility was needed.  Again, this was
   because the option predates the standardization of the ignore
   files.

 * git-merge-recursive uses hardcoded per-directory .gitignore
   and nothing else.  git-clean (scripted version) does not
   honor core.* because its call to underlying ls-files does not
   know about it.  git-clean in C (parked in 'pu') doesn't either.

We probably could change git-ls-files to use the standard set
when no excludes are specified on the command line and ignore
processing was asked, or something like that, but that will be a
change in semantics and might break people's scripts in a subtle
way.  I am somewhat reluctant to make such a change.

On the other hand, I think it makes perfect sense to fix
git-read-tree, git-merge-recursive and git-clean to follow the
same rule as other commands.  I do not think of a valid use case
to give an exclude-per-directory that is nonstandard to
read-tree command, outside a "negative" test in the t1004 test
script.

This patch is the first step to untangle this mess.

The next step would be to teach read-tree, merge-recursive and
clean (in C) to use setup_standard_excludes().

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-11-16 17:05:02 -08:00
Wincent Colaiuta
2587d67966 Fix t9101 test failure caused by Subversion "auto-props"
If a user has an "auto-prop" in his/her ~/.subversion/config file for
automatically setting the svn:keyword Id property on all ".c" files
(a reasonably common configuration in the Subversion world) then one
of the "svn propset" operations in the very first test would become a
no-op, which in turn would make the next commit a no-op.

This then caused the 25th test ('test propget') to fail because it
expects a certain number of commits to have taken place but the actual
number of commits was off by one.

Björn Steinbrink identified the "auto-prop" feature as the cause
of the failure. This patch avoids it by passing the "--no-auto-prop"
flag to "svn import" when setting up the test repository, thus ensuring
that the "svn propset" operation is no longer a no-op, regardless of the
users' settings in their config.

Signed-off-by: Wincent Colaiuta <win@wincent.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-11-16 16:55:46 -08:00
Jeff King
8291db6f58 git-send-email: add charset header if we add encoded 'From'
We sometimes pick out the original rfc822 'From' header and
include it in the body of the message. If the original
author's name needs encoding, then we should specify that in
the content-type header.

If we already had a content-type header in the mail, then we
may need to re-encode. The logic is there to detect
this case, but it doesn't actually do the re-encoding.

Signed-off-by: Jeff King <peff@peff.net>
Acked-by: Uwe Kleine-König <Uwe.Kleine-Koenig@digi.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-11-16 16:53:54 -08:00
Simon Hausmann
38f9f5ec41 git-p4: Fix direct import from perforce after fetching changes through git from origin
When using an existing git repository to cache the perforce import we don't
fetch the branch mapping from perforce as that is a slow operation. However
the origin repository may not be fully up-to-date and therefore it may be
necessary to import more changes directly from Perforce.

Such a direct import needs self.knownBranches to be set up though, so
initialize it from the existing p4/* git branches.

Signed-off-by: Simon Hausmann <simon@lst.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-11-16 01:32:59 -08:00
Junio C Hamano
41a7aa588f Fix per-directory exclude handing for "git add"
In "dir_struct", each exclusion element in the exclusion stack records a
base string (pointer to the beginning with length) so that we can tell
where it came from, but this pointer is just pointing at the parameter
that is given by the caller to the push_exclude_per_directory()
function.

While read_directory_recursive() runs, calls to excluded() makes use
the data in the exclusion elements, including this base string.  The
caller of read_directory_recursive() is not supposed to free the
buffer it gave to push_exclude_per_directory() earlier, until it
returns.

The test case Bruce Stephens gave in the mailing list discussion
was simplified and added to the t3700 test.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-11-16 01:16:22 -08:00
Sergei Organov
c1a95fa629 Documentation: customize diff-options depending on particular command
Customize diff-options depending on particular command as follows,
mostly to make git-diff and git-format-patch manuals less confusing:

* git-format-patch:

  - Mark --patch-with-stat as being the default.

  - Change -p description so that it matches what it actually does and
    so that it doesn't refer to absent "section on generating
    patches".

* git-diff: mark -p as being the default.

* git-diff-index/git-diff-files/git-diff-tree: mark --raw as being
  the default.

Signed-off-by: Sergei Organov <osv@javad.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-11-15 22:44:17 -08:00
Jeff King
8e7b07c8a7 git-ls-files: add --exclude-standard
This provides a way for scripts to get at the new standard exclude
function.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-11-15 22:24:10 -08:00
Guido Ostkamp
a777e9ca54 Remove unreachable statements
Solaris Workshop Compiler found a few unreachable statements.

Signed-off-by: Guido Ostkamp <git@ostkamp.fastmail.fm>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-11-15 21:23:47 -08:00
Johannes Sixt
549799b4a1 refs.c: Remove unused get_ref_sha1()
Signed-off-by: Johannes Sixt <johannes.sixt@telecom.at>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-11-15 21:16:51 -08:00
Junio C Hamano
039bc64e88 core.excludesfile clean-up
There are inconsistencies in the way commands currently handle
the core.excludesfile configuration variable.  The problem is
the variable is too new to be noticed by anything other than
git-add and git-status.

 * git-ls-files does not notice any of the "ignore" files by
   default, as it predates the standardized set of ignore files.
   The calling scripts established the convention to use
   .git/info/exclude, .gitignore, and later core.excludesfile.

 * git-add and git-status know about it because they call
   add_excludes_from_file() directly with their own notion of
   which standard set of ignore files to use.  This is just a
   stupid duplication of code that need to be updated every time
   the definition of the standard set of ignore files is
   changed.

 * git-read-tree takes --exclude-per-directory=<gitignore>,
   not because the flexibility was needed.  Again, this was
   because the option predates the standardization of the ignore
   files.

 * git-merge-recursive uses hardcoded per-directory .gitignore
   and nothing else.  git-clean (scripted version) does not
   honor core.* because its call to underlying ls-files does not
   know about it.  git-clean in C (parked in 'pu') doesn't either.

We probably could change git-ls-files to use the standard set
when no excludes are specified on the command line and ignore
processing was asked, or something like that, but that will be a
change in semantics and might break people's scripts in a subtle
way.  I am somewhat reluctant to make such a change.

On the other hand, I think it makes perfect sense to fix
git-read-tree, git-merge-recursive and git-clean to follow the
same rule as other commands.  I do not think of a valid use case
to give an exclude-per-directory that is nonstandard to
read-tree command, outside a "negative" test in the t1004 test
script.

This patch is the first step to untangle this mess.

The next step would be to teach read-tree, merge-recursive and
clean (in C) to use setup_standard_excludes().

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-11-14 15:08:04 -08:00
Junio C Hamano
f5f6cb87de Merge branch 'sp/fetch-fix'
* sp/fetch-fix:
  git-fetch: avoid local fetching from alternate (again)
  rev-list: Introduce --quiet to avoid /dev/null redirects
  run-command: Support sending stderr to /dev/null
  git-fetch: Always fetch tags if the object they reference exists
2007-11-14 14:26:04 -08:00
Junio C Hamano
b2e163272c Merge branch 'bs/maint-commit-options'
* bs/maint-commit-options:
  git-commit: Add tests for invalid usage of -a/--interactive with paths
  git-commit.sh: Fix usage checks regarding paths given when they do not make sense
2007-11-14 14:25:46 -08:00
Junio C Hamano
43f36901c5 Merge branch 'rv/maint-index-commit'
* rv/maint-index-commit:
  Make GIT_INDEX_FILE apply to git-commit
2007-11-14 14:25:33 -08:00
Junio C Hamano
9f165805f3 Merge branch 'bs/maint-t7005'
* bs/maint-t7005:
  t7005-editor.sh: Don't invoke real vi when it is in GIT_EXEC_PATH
2007-11-14 14:25:19 -08:00
Junio C Hamano
c78a24986d Merge branch 'jc/maint-add-sync-stat'
* jc/maint-add-sync-stat:
  t2200: test more cases of "add -u"
  git-add: make the entry stat-clean after re-adding the same contents
  ce_match_stat, run_diff_files: use symbolic constants for readability

Conflicts:

	builtin-add.c
2007-11-14 14:15:40 -08:00
Junio C Hamano
ef4de8357d Merge branch 'mh/retag'
* mh/retag:
  Add tests for git tag
  Reuse previous annotation when overwriting a tag
2007-11-14 14:06:09 -08:00
Junio C Hamano
5e389c430d Merge branch 'jc/stash-create'
* jc/stash-create:
  git-stash: Fix listing stashes
  git-merge: no reason to use cpio anymore
  Revert "rebase: allow starting from a dirty tree."
  rebase: allow starting from a dirty tree.
  stash: implement "stash create"
2007-11-14 14:05:47 -08:00
Junio C Hamano
55571f7861 Merge branch 'bg/format-patch-N'
* bg/format-patch-N:
  Rearrange git-format-patch synopsis to improve clarity.
  format-patch: Test --[no-]numbered and format.numbered
  format-patch: Add configuration and off switch for --numbered
2007-11-14 14:04:25 -08:00
Junio C Hamano
03edb0a753 Merge branch 'np/progress'
* np/progress:
  nicer display of thin pack completion
  make display of total transferred fully accurate
  remove dead code from the csum-file interface
  git-fetch: be even quieter.
  make display of total transferred more accurate
  sideband.c: ESC is spelled '\033' not '\e' for portability.
  fix display overlap between remote and local progress
2007-11-14 14:04:19 -08:00
Junio C Hamano
dcb83ec18d Merge branch 'js/rebase-detached'
* js/rebase-detached:
  rebase: fix "rebase --continue" breakage
  rebase: operate on a detached HEAD
2007-11-14 14:04:06 -08:00
Junio C Hamano
37ec2b4c26 Merge branch 'rs/pretty'
* rs/pretty:
  Fix preprocessor logic that determines the availablity of strchrnul().
  Simplify strchrnul() compat code
  --format=pretty: avoid calculating expensive expansions twice
  add strbuf_adddup()
  --pretty=format: parse commit message only once
  --pretty=format: on-demand format expansion
  Add strchrnul()
2007-11-14 14:03:50 -08:00
Junio C Hamano
4356736571 Merge branch 'rr/cvsexportcommit-w'
* rr/cvsexportcommit-w:
  cvsexportcommit: Add switch to specify CVS workdir
2007-11-14 14:03:40 -08:00