Age | Commit message (Collapse) | Author |
|
Add a missing space after the "--" marker that introduces the patch
signature.
Signed-off-by: Lukas Fleischer <cgit@cryptocrack.de>
|
|
Add max_parents = 1 to the revision walk in order to make sure we do not
include the footer signature twice for merge commits.
Signed-off-by: Lukas Fleischer <cgit@cryptocrack.de>
|
|
Rename parameters and local variables to match those from ui-diff. Also,
convert a "char *" to "const char *".
Signed-off-by: Lukas Fleischer <cgit@cryptocrack.de>
|
|
This allows for specifying a revision range using the id2 parameter of
/patch/. The output that is produced is similar to
$ git format-patch --stdout id2..id
Signed-off-by: Lukas Fleischer <cgit@cryptocrack.de>
|
|
Instead of using our own formatting, use log_tree_commit() from Git to
create patches. This removes unnecessary duplicate code and also fixes a
bug with e-mail address formatting that existed in our own
implementation.
Signed-off-by: Lukas Fleischer <cgit@cryptocrack.de>
|
|
Move filepair_cb() from ui-patch.c to ui-shared.c and rename it to
filepair_cb_raw(). This callback will be used in ui-diff.c in a
follow-up patch.
Note that it is not straightforward to extract filepair_cb() from
ui-diff.c which is why it is not done here as well.
Signed-off-by: Lukas Fleischer <cgit@cryptocrack.de>
|
|
This removes many uses of "fmt" which uses a fixed size static pool of
fixed size buffers. Instead of relying on these, we now pass around
argument lists for as long as possible before using a strbuf to render
content of an arbitrary size.
Signed-off-by: John Keeping <john@keeping.me.uk>
|
|
While doing this, remove declarations from header files where the
corresponding definition is declared "static" in order to avoid build
errors.
Also re-order existing headers in ui-*.c so that the file-specific
header always comes immediately after "cgit.h", helping with future
consistency.
Signed-off-by: John Keeping <john@keeping.me.uk>
|
|
We already have a global cgit_version which is set from the #define'd
CGIT_VERSION in cgit.c. Change ui-patch.c to use this so that we only
need to rebuild cgit.o when the version changes.
Signed-off-by: John Keeping <john@keeping.me.uk>
|
|
Copying the output of cgit and using it in patches now works when adding
files to or removing files from the repository. This is helpful for people
who use cgit in their patch workflow.
|
|
The new ctx.qry.ignorews variable is passed via cgit_diff_files() and
cgit_diff_tree() to Git's diff machinery. This is equivalent to passing
--ignore-all-space to 'git diff'.
Signed-off-by: Johan Herland <johan@herland.net>
|
|
The new ctx.qry.context variable is picked up by cgit_print_diff(), and
passed via cgit_diff_files() to Git's diff machinery.
Signed-off-by: Johan Herland <johan@herland.net>
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
|
|
Also indicate in the comment section of the patch that a path limit was
applied, too easily see when a generated patch is only partial.
Signed-off-by: Johan Herland <johan@herland.net>
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
|
|
Signed-off-by: Martin Szulecki <opensuse@sukimashita.com>
|
|
This teaches all diff-related operations (i.e. ui-log, ui-diff and ui-patch)
how to handle binary files.
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
|
|
Add a space between the committer name and email, and remove
superfluous spaces in the date header.
This makes cgit-generated patches match the output from git-format-patch
almost exactly, at least as far as the email headers go.
Signed-off-by: Tomas Carnecky <tom@dbservice.com>
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
|
|
When `local-time` is set, commit, tag and patch timestamps will be printed
in the servers timezone. Also, regardless of the value of `local-time`,
these timestamps will now always show the timezone.
Signed-off-by: Stefan Naewe <stefan.naewe@atlas-elektronik.com>
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
|
|
* lh/cleanup: (21 commits)
Reset ctx.repo to NULL when the config parser is finished
Move cgit_parse_query() from parsing.c to html.c as http_parse_querystring()
Move function for configfile parsing into configfile.[ch]
Add cache.h
Remove global and obsolete cgit_cmd
Makefile: copy the QUIET constructs from the Makefile in git.git
Move cgit_version from shared.c to cgit.c
Makefile: autobuild dependency rules
Initial Makefile cleanup
Move non-generic functions from shared.c to cgit.c
Add ui-shared.h
Add separate header-files for each page/view
Refactor snapshot support
Add command dispatcher
Remove obsolete cacheitem parameter to ui-functions
Add struct cgit_page to cgit_context
Introduce html.h
Improve initialization of git directory
Move cgit_repo into cgit_context
Add all config variables into struct cgit_context
...
|
|
This is finally a proper headerfile for the shared ui-functions which
used to reside in cgit.h
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
|
|
This parameter hasn't been used for a very long time...
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
|
|
This struct is used when generating http headers, and as such is another
small step towards the goal of the whole cleanup series; to invoke each
page/view function with a function pointer.
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
|
|
All html-functions can be quite easily separated from the rest of cgit, so
lets do it; the only issue was html_filemode which uses some git-defined
macros so the function is moved into ui-shared.c::cgit_print_filemode().
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
|
|
The code for patch view assumed the current commit would always have a parent,
which made cgit segfault when that wasn't the case.
This fixes the bug and adds a test-script for patch view which includes a test
for the inital commit.
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
|
|
This struct will hold all the cgit runtime information currently found in
a multitude of global variables.
The first cleanup removes all querystring-related variables.
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
|
|
While at it, make sure the commit message ends with a '\n'.
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
|
|
The new view mimics the output from `git format-patch`, making it possible
to cherry-pick directly from cgit with something like `curl $url | git am`.
Inspired by a patch to `git-apply` by Mike Hommey:
http://thread.gmane.org/gmane.comp.version-control.git/67611/focus=67610
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
|