summaryrefslogtreecommitdiff
path: root/gbp/git
AgeCommit message (Collapse)Author
2013-04-07GitRepository.show: use _git_inout()Markus Lehtonen
Instead of the deprecated _git_getoutput() method. Also, capture stderr and put the error message to the exception, instead. Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
2013-03-22GitArgs: utilize the add() method in other add_X methodsMarkus Lehtonen
Only use the add() method for updating the argument list. This makes the code more robust and makes all add method variant types support the same argument types. Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
2013-03-22GitRepository/_cmd_has_feature: more intelligent parsingMarkus Lehtonen
More intelligent parsing of the git output (man page). Try to parse optional options like '--[no-]standard-notes' of git-show correctly. In this example both 'no-standard-notes' and 'standard-notes' would be available. Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
2012-11-27Check the sha1 doesn't exceed 40 bytesGuido Günther
2012-11-27GitRepository/strip_sha1: fix length checkingMarkus Lehtonen
Accept longer sha1 than what was asked for. The length option given to git is merely a "wish to get a sha1 of this length". Git may also return longer sha1 if truncating to given length would give ambiguous/non-unique sha1. Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
2012-11-24GitRepository/has_submodules: use correct .gitmodules fileMarkus Lehtonen
Examine .gitmodules from the "root directory" of the repo, not the current working directory. Fixes has_submodules() method, when called from arbitrary cwd. Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
2012-11-24GitRepository/get_commit_info: support tagsMarkus Lehtonen
Dereference the given revision to a commit. Fixes get_commit_info() when called for a tag. Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
2012-11-23GitRepository/get_submodules: use correct pathMarkus Lehtonen
By default, run git in the repo path, not current cwd. Also, now returns submodule paths without leading './'. Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
2012-11-23GitRepository/get_commits: more flexible revision rangesMarkus Lehtonen
Support getting the complete history of an arbitrary commit-ish (since=None, until=COMMIT-ISH). Formerly this was only possible for the current git HEAD. Now, get_commits(since=None, until='COMMIT') translates to 'git log COMMIT'. Also, for consistency, add support for getting the history from an arbitrary commit until the current HEAD (since=COMMIT-ISH, until=None). Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
2012-11-23Add sha1 stripping in a single placeGuido Günther
so we can easily sanity check the result.
2012-11-07GitRepository/diff: catch git errorMarkus Lehtonen
Raise an exception if the git command fails. Also, utilize _git_inout() instead of the deprecated _git_getoutput(). Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
2012-11-07GitRepository/diff: add 'paths' argumentMarkus Lehtonen
Makes the diff function more versatile. I.e. makes diffing only certain paths possible. Also, add basic unittests for the diff() method. Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
2012-11-07GitRepository.find_tag: change deprecated _git_getoutput to _git_inoutEd Bartosh
Signed-off-by: Ed Bartosh <eduard.bartosh@intel.com> Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
2012-11-07GitRepository: fix merge() for older git versionsMarkus Lehtonen
Utilize _cmd_has_feature() in GitRepository.merge() to not give edit/no-edit option for older versions of git-merge, that don't support it. Fixes a regression (with git-version < 1.7.8) caused by commit f3aa87fa0361a. Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
2012-11-07GitRepository: implement _cmd_has_feature() methodMarkus Lehtonen
This method is intended for checking if the local git (client) command supports a certain feature. The "feature" is considered to be a command line option. E.g. does "merge" command have the "edit" feature translates to does git-merge support the '--edit' command line option. To figure this out, _cmd_has_feature() parses through the "OPTIONS" section of the man page of the git command. Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
2012-10-25PEP-8 and pyflakes cleanupsGuido Günther
2012-08-22GitArgs/add: support iterable and non-string argsMarkus Lehtonen
Support giving iterables (other than basestring, e.g. list(s)) as an argument to GitArgs.add(). Also, add support non-iterable arguments that support the str() conversion. Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
2012-08-22GitRepository: Implement set_upstream_branch and get_upstream_branch methodsEd Bartosh
set_upstream_branch sets upstream branch for the local branch using git branch --set-upstream get_upstream_branch returns info about upstream branches Signed-off-by: Ed Bartosh <eduard.bartosh@intel.com>
2012-08-22GitRepository/branch_contains: remove prefix '*' in branch nameZhang Qiang
The git output always prefixes the current branch name with '*'. Without this fix branch_contains() always fails for the currently active branch. Signed-off-by: Zhang Qiang <qiang.z.zhang@intel.com>
2012-07-31Remove multiple spacesGuido Günther
2012-07-29GitModifier: use __getitem__ to fetch dateGuido Günther
instead of accessing __dict__ directly which only has _date.
2012-07-28GitRepository: raise GitRepositoryError on git errorsGuido Günther
Raise GitRepositoryError in cases where CommandExecFailed (from GitCommand) was previously silently passed forward. Heavily based on a patch by Markus Lehtonen <markus.lehtonen@linux.intel.com>
2012-07-27GitRepository/get_commit_info: add file statusMarkus Lehtonen
Add file status and name to the info returned by the get_commit_info() method. Signed-off-by: Zhang Qiang <qiang.z.zhang@intel.com> Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
2012-07-27GitRepository/get_commit_info: add committer infoMarkus Lehtonen
Add committer to the info returned by get_commit_info() method. Returns committer name, email and timestamp as a GitModifier object. Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
2012-07-27GitRepository/get_commit_info: add author timestampMarkus Lehtonen
Add author timestamps to the info returned by get_commit_info() method. Signed-off-by: Ed Bartosh <eduard.bartosh@intel.com> Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
2012-07-27GitModifier: More flexible date handlingGuido Günther
Allow to pass in the date as datetime object, timestamp or git raw date. and allow to retrieve these values. This make constructing GitModifiers from python simpler.
2012-07-27Fix variable renamingGuido Günther
2012-07-24GitRepository: option to ignore untracked in is_clean()Markus Lehtonen
Add an option to ignore untracked files when checking if the repository is clean. Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
2012-07-24GitRepository/get_author_info: return user.name as nameMarkus Lehtonen
Return users full name (user.name) instead of email (user.email) as the 'name' of the author when taking the value from git config. Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
2012-07-23gbp.git.GitRepository: Add remove_remoteGuido Günther
2012-07-23git.repository.GitRepository.add_remote_repo: use GitArgsGuido Günther
2012-07-03GitRepository: Make rev_parse's short option an int everywhereGuido Günther
2012-07-03GitRepository/rev_parse: add new argument 'short'Markus Lehtonen
Adds a new argument to get abbreviated SHA1. Also, modifies rev_parse() to use GitArgs class. Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
2012-07-02GitRepository/get_commit_info: check return value of git command correctlyMarkus Lehtonen
Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
2012-07-02Make exception syntax consistentGuido Günther
2012-06-30GitRepository: return GitModifier object instead of separate fieldsGuido Günther
this make sure the number of return values doesn't stays sane when also returning timestamps and committer information.
2012-06-30GitRepository: make get_commit_info() more robustMarkus Lehtonen
Now uses git-show instead of git-log. This is needed for further enhancements (namely to get name-status for merge commits). Also, use null-character as the field separator which makes parsing more reliable. The method now returns 'body' of the commit message as is, without stripping or splitting to lines. In addition, get_commit_info() now uses GitArgs and _git_inout() instead of the deprecated _git_getoutput(). Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
2012-06-30GitRepository: fix process cwd in _git_inout()Markus Lehtonen
Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
2012-06-17common/pq: use strip in apply_and_commit_patch()Markus Lehtonen
Use the strip information of the patch when applying patches. Also, changes GitRepository.apply_patch() to accept integer values as 'strip' argument. Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
2012-05-31gbp.git.repository: add GitRepository.make_treeGuido Günther
Signed-off-by: Guido Günther <agx@sigxcpu.org>
2012-05-31gbp.git.repository: Add GitRepository.write_fileGuido Günther
Signed-off-by: Guido Günther <agx@sigxcpu.org>
2012-05-31gbp.git.repository: Add GitRepository.list_treeGuido Günther
2012-05-14gbp.git.repository: Add a "git merge-base" wrapperDaniel Dehennin
Closes: #672642 Signed-off-by: Guido Günther <agx@sigxcpu.org>
2012-05-04GitRepository.format_patches: allow to set threading formatGuido Günther
and disable it by default.
2012-04-15Ignore locale when checking for a clean repositoryGuido Günther
Closes: #668896
2012-04-05gbp.git.repository: don't append a second .gitGuido Günther
when mirroring a repository
2012-03-19GitRepository.clone(): document missing optionsGuido Günther
2012-03-19GitRepository.create(): use GitArgsGuido Günther
Git-Dch: Ignore
2012-03-15GitModifier: add __getitem__ and keys()Guido Günther
so it can be used as dictonary
2012-02-26GitRepository.merge: add edit optionGuido Günther
defaulting to False Closes: #659239