private void processTag(RevObject obj) { final RevTag tag = (RevTag) obj; needs(tag.getObject()); obj.add(COMPLETE); }
ObjectId taggedCommitId = revTag.getObject().getId(); log.info("Resolved tag [{}] [{}], points at [{}] ", revTag.getTagName(), revTag.getTaggerIdent(), taggedCommitId); taggedCommitId = walk.parseTag(taggedCommitId).getObject().getId();
/** * Parse an annotated tag from its canonical format. * * This method constructs a temporary revision pool, parses the tag as * supplied, and returns it to the caller. Since the tag was built inside of * a private revision pool its object pointer will be initialized, but will * not have its headers loaded. * * Applications are discouraged from using this API. Callers usually need * more than one object. Use * {@link org.eclipse.jgit.revwalk.RevWalk#parseTag(AnyObjectId)} to obtain * a RevTag from an existing repository. * * @param raw * the canonical formatted tag to be parsed. * @return the parsed tag, in an isolated revision pool that is not * available to the caller. * @throws org.eclipse.jgit.errors.CorruptObjectException * the tag contains a malformed header that cannot be handled. */ public static RevTag parse(byte[] raw) throws CorruptObjectException { return parse(new RevWalk((ObjectReader) null), raw); }
public DatedRevTag(RevTag tag) { this(tag.getId(), tag.getTagName(), (tag.getTaggerIdent() != null) ? new DateTime(tag.getTaggerIdent().getWhen()) : DateTime.now().minusYears(1900)); }
final RevTag t = new RevTag(id); t.parseCanonical(this, getCachedBytes(t, ldr)); r = t; break;
@NotNull @Override public ObjectId convert(@NotNull Repository dstRepo, @NotNull ObjectInserter inserter, @NotNull ConvertResolver resolver, @Nullable Uploader uploader) throws IOException { final ObjectId id = resolver.resolve(TaskType.Simple, "", revObject.getObject()); final TagBuilder builder = new TagBuilder(); builder.setMessage(revObject.getFullMessage()); builder.setTag(revObject.getTagName()); builder.setTagger(revObject.getTaggerIdent()); builder.setObjectId(id, revObject.getObject().getType()); return inserter.insert(builder); } };
.setMessage(tag.getFullMessage()) .setName(newBranchname) .setObjectId(tag.getObject()) .setTagger(tag.getTaggerIdent()) .call(); mRepo.getGit().tagDelete()
private void setExistingTag(Object tagObject) { if (tagObject instanceof RevTag) existingTag = (RevTag) tagObject; else { setNoExistingTag(); setErrorMessage(UIText.CreateTagDialog_LightweightTagMessage); return; } if (!tagNameText.getText().equals(existingTag.getTagName())) tagNameText.setText(existingTag.getTagName()); if (commitCombo != null) commitCombo.setSelectedElement(existingTag.getObject()); // handle un-annotated tags String message = existingTag.getFullMessage(); tagMessageText.setText(null != message ? message : ""); //$NON-NLS-1$ }
private void show(RevTag tag) throws IOException { outw.print(CLIText.get().tagLabel); outw.print(" "); //$NON-NLS-1$ outw.print(tag.getTagName()); outw.println(); final PersonIdent tagger = tag.getTaggerIdent(); if (tagger != null) { outw.println(MessageFormat.format(CLIText.get().taggerInfo, tagger.getName(), tagger.getEmailAddress())); final TimeZone taggerTZ = tagger.getTimeZone(); fmt.setTimeZone(taggerTZ != null ? taggerTZ : myTZ); outw.println(MessageFormat.format(CLIText.get().dateInfo, fmt.format(tagger.getWhen()))); } outw.println(); final String[] lines = tag.getFullMessage().split("\n"); //$NON-NLS-1$ for (final String s : lines) { outw.print(" "); //$NON-NLS-1$ outw.print(s); outw.println(); } outw.println(); }
@Override public String getTagName() { if (tagRef == null) { return null; } return tagRef.getTagName(); }
long timeof(RevObject o) { if (o instanceof RevCommit) return ((RevCommit) o).getCommitTime(); if (o instanceof RevTag) { RevTag tag = (RevTag) o; try { parseBody(tag); } catch (IOException e) { return 0; } PersonIdent who = tag.getTaggerIdent(); return who != null ? who.getWhen().getTime() : 0; } return 0; }
RevTag t = walk.parseTag(objectId); appendObjectSummary(sb, UIText.RefContentProposal_tag, t .getTaggerIdent(), t.getFullMessage()); break; case Constants.OBJ_TREE:
try { RevTag annotatedTag = revWalk.parseTag(ref.getObjectId()); snapshots.add(annotatedTag.getTagName() + " : " + annotatedTag.getFullMessage()); } catch (IncorrectObjectTypeException ex) { snapshots.add(ref.getName());
private void addToTags( final Map<String, Set<GitCommit>> commitsPerTag, final String tagName, final Date tagTime, final List<GitTag> addTo, final Map<String, RevTag> annotatedTagPerTagName) { if (commitsPerTag.containsKey(tagName)) { final Set<GitCommit> gitCommits = commitsPerTag.get(tagName); final boolean isAnnotated = annotatedTagPerTagName.containsKey(tagName); String annotation = null; if (isAnnotated) { annotation = annotatedTagPerTagName.get(tagName).getFullMessage(); } final GitTag gitTag = new GitTag(tagName, annotation, newArrayList(gitCommits), tagTime); addTo.add(gitTag); } }
@Override public void loadTag(GitTag tag) throws GitRepositoryException { if (tag.isLoaded()) { return; } assert revWalk != null; JGitTag jgitTag = (JGitTag) tag; try { revWalk.parseBody(jgitTag.tag); jgitTag.taggerIdent = jgitTag.tag.getTaggerIdent(); } catch (IOException e) { throw new GitRepositoryException("Failed to load tag meta data.", e); } finally { jgitTag.tag.disposeBody(); } }
/** * Parse the complete tag message and decode it to a string. * <p> * This method parses and returns the message portion of the tag buffer, * after taking the tag's character set into account and decoding the buffer * using that character set. This method is a fairly expensive operation and * produces a new string on each invocation. * * @return decoded tag message as a string. Never null. */ public final String getFullMessage() { byte[] raw = buffer; int msgB = RawParseUtils.tagMessage(raw, 0); if (msgB < 0) { return ""; //$NON-NLS-1$ } return RawParseUtils.decode(guessEncoding(), raw, msgB, raw.length); }
/** * Locate a reference to a tag without loading it. * <p> * The tag may or may not exist in the repository. It is impossible to tell * from this method's return value. * * @param id * name of the tag object. * @return reference to the tag object. Never null. */ @NonNull public RevTag lookupTag(AnyObjectId id) { RevTag c = (RevTag) objects.get(id); if (c == null) { c = new RevTag(id); objects.add(c); } return c; }
.setMessage(tag.getFullMessage()) .setName(newBranchname) .setObjectId(tag.getObject()) .setTagger(tag.getTaggerIdent()) .call(); mRepo.getGit().tagDelete()
PersonIdent referenceTagger = referenceTag.getTaggerIdent(); PersonIdent thisTagger = tag.getTaggerIdent(); if (thisTagger != null && referenceTagger != null && thisTagger.getWhen().after(referenceTagger.getWhen())) { String msg = "Peeled tag " + tag.getTagName() + " does not point to a commit, but to the following object: " + peeled; TagBuilder tagBuilder = new TagBuilder(); tagBuilder.setTag(tagName); tagBuilder.setMessage(referenceTag.getFullMessage()); tagBuilder.setTagger(referenceTag.getTaggerIdent()); tagBuilder.setObjectId(mergeCommit, Constants.OBJ_COMMIT); try (ObjectInserter inserter = repository.newObjectInserter()) {